Check double-lock in Mutex. Update book keeping on unlock.

This commit is contained in:
Patrick Mahoney committed 2011-12-11 22:57:57 -06:00
1 parent 44d1e79a10
commit b4b869e074
2 files changed
+14 -1

No files matched your search

+8
View File
@@ -70,5 +70,13 @@ module ProcessShared
::Process.wait(pid)
end
it 'raises exception when locked twice by same process' do
mutex = Mutex.new
mutex.lock
proc { mutex.lock }.must_raise(ProcessError)
mutex.unlock
end
end
end