Improved file lock.

This commit is contained in:
Martin Edenhofer 2013-04-15 23:28:36 +02:00
parent 57d1d8288b
commit a6625c9467

View file

@ -68,12 +68,12 @@ module Session
File.open( session_file, 'rb' ) { |file|
file.flock( File::LOCK_EX )
all = file.read
file.flock( File::LOCK_UN )
begin
data = Marshal.load( all )
rescue
return
end
file.flock( File::LOCK_UN )
}
return data
end