⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Backport187
All Projects
Ruby
»
Backport187
Overview
Activity
Issues
Like
Download (261 Bytes)
Backport #1471
» mutual_join_bug.rb
Test script. -
JohnCarter (John Carter)
, 05/15/2009 05:19 PM
require
'thread'
m
=
Mutex
.
new
m
.
lock
wt2
=
Thread
.
new
do
m
.
lock
sleep
2
m
.
unlock
end
# Ensure wt2 is waiting on m
sleep
0.1
wt1
=
Thread
.
new
do
m
.
lock
m
.
unlock
end
# Ensure wt1 is waiting on m
sleep
0.1
# Give it to wt2
m
.
unlock
wt1
.
join
« Previous
1
2
3
Next »
(1-1/3)
Loading...