33件ヒット
[1-33件を表示]
(0.107秒)
クラス
-
File
:: Stat (11) - Mutex (2)
- Pathname (11)
-
Thread
:: Mutex (9)
検索結果
先頭4件
-
Mutex
# sleep(timeout = nil) -> Integer (18226.0) -
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
...与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
@param timeout スリープする秒数を指定します。省略するとスリープし続けます。
@return スリープしていた秒数を返します。
@raise ThreadError......グナルを受信した場合などに実行が再
開(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
//}... -
Thread
:: Mutex # sleep(timeout = nil) -> Integer (18226.0) -
与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
...与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
@param timeout スリープする秒数を指定します。省略するとスリープし続けます。
@return スリープしていた秒数を返します。
@raise ThreadError......グナルを受信した場合などに実行が再
開(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
//}......与えられた秒数の間ロックを解除してスリープして、実行後にまたロックします。
@param timeout スリープする秒数を指定します。省略するとスリープし続けます。
@return タイムアウトした時は nil を、それ以外はスリープし... -
File
:: Stat # birthtime -> Time (6220.0) -
作成された時刻を返します。
...birthtime のない環境で発生します。
//emlist[][ruby]{
File.write("testfile", "foo")
sleep 10
File.write("testfile", "bar")
sleep 10
File.chmod(0644, "testfile")
sleep 10
File.read("testfile")
File.stat("testfile").birthtime #=> 2014-02-24 11:19:17 +0900
File.stat("testfile").mtime......#=> 2014-02-24 11:19:27 +0900
File.stat("testfile").ctime #=> 2014-02-24 11:19:37 +0900
File.stat("testfile").atime #=> 2014-02-24 11:19:47 +0900
//}... -
Pathname
# ctime -> Time (6208.0) -
File.ctime(self.to_s) を渡したものと同じです。
....ctime(self.to_s) を渡したものと同じです。
//emlist[例][ruby]{
require 'pathname'
IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}
@see File.ctime...