dkubb / ice_nine

Deep Freeze Ruby Objects
MIT License
307 stars 19 forks source link

Fix cache race #18

Closed mbj closed 9 years ago

mbj commented 9 years ago

@dkubb Ready for review.

Scope is to get the build green on rspec3 while fixing the race on cache[mod]. I think a mutex is another option, but adding a mutex just to force sequenctial evaluation of the default block body against an idempotent write into a cache is overkill.

Lifting the lvar in the outer scope has IMO the same semantics.

Mutant passes with this changes and does not trigger that race anymore.

mbj commented 9 years ago

@dkubb Ready for next pass.