Skip to content

Commit

Permalink
Cleanup threads
Browse files Browse the repository at this point in the history
  • Loading branch information
dv committed Apr 17, 2016
1 parent 319760b commit 1d11867
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions spec/semaphore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,12 @@
it "gracefully expires stale lock" do
expiration = 1

Thread.new do
semaphore.simple_expiring_mutex(:test, expiration) do
sleep 3
thread =
Thread.new do
semaphore.simple_expiring_mutex(:test, expiration) do
sleep 3
end
end
end

sleep 1.5

Expand All @@ -303,6 +304,7 @@
end

expect(it_worked).to be_truthy
thread.join
end
end
end

0 comments on commit 1d11867

Please sign in to comment.