るりまサーチ (Ruby 2.1.0)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.026秒)
トップページ > バージョン:2.1.0[x] > クエリ:Time[x] > クエリ:status[x] > クラス:Mutex[x]

別のキーワード

  1. time httpdate
  2. time iso8601
  3. time rfc2822
  4. time strptime
  5. time parse

ライブラリ

検索結果

Mutex#sleep(timeout = nil) -> Integer (358.0)

与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。

...グナルを受信した場合などに実行が再
開(spurious wakeup)される場合がある点に注意してください。

//emlist[例][ruby]{
m = Mutex.new
th = Thread.new do
m.lock
m.sleep(2)
end
th.status # => "run"
sleep 1
th.status # => "sleep"
sleep 1
th.status # => false
//}...