Skip to content

Commit

Permalink
explicitly test the thread safety of Hitimes::Stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
copiousfreetime committed Jan 10, 2013
1 parent 139a4e4 commit f7cdcdf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions spec/mutex_stats_spec.rb
Expand Up @@ -16,8 +16,13 @@ def run_with_scissors( stats, threads, iters )
return stats
end

it "is unsafe normally" do
pending "not for MRI -- not interruptable in this C extension" do
if (not defined? RUBY_ENGINE) or (RUBY_ENGINE == "ruby") then
it "Hitimes::Stats is threadsafe" do
stats = run_with_scissors( ::Hitimes::Stats.new, @threads, @iters )
stats.count.should== @final_value
end
else
it "Hitimes::Stats is not threadsafe" do
stats = run_with_scissors( ::Hitimes::Stats.new, @threads, @iters )
stats.count.should_not == @final_value
end
Expand Down

0 comments on commit f7cdcdf

Please sign in to comment.