From a6625c946730b9e18e5f11bc289c8caa4e4ba693 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 15 Apr 2013 23:28:36 +0200 Subject: [PATCH] Improved file lock. --- lib/session.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/session.rb b/lib/session.rb index a805b5fc9..202408355 100644 --- a/lib/session.rb +++ b/lib/session.rb @@ -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