Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flock defaults to LOCK_NB #496

Closed
thejefflarson opened this issue Jan 14, 2013 · 3 comments
Closed

Flock defaults to LOCK_NB #496

thejefflarson opened this issue Jan 14, 2013 · 3 comments
Milestone

Comments

@thejefflarson
Copy link

File.flock defaults to a LOCK_NB lock which is different than MRI which blocks if you call flock with LOCK_EX. Test case:

https://gist.github.com/4527948

It should block forever on the second call.

@minad
Copy link

minad commented Jan 14, 2013

It only defaults to a LOCK_NB if the process already holds a lock.

@MSNexploder
Copy link
Contributor

Works as expected for me (blocks forever) on jruby 1.7.13 / OSX 10.9.4

@rtyler
Copy link

rtyler commented Aug 7, 2015

Tested this on JRuby 9k, and the blocking behavior is consistent with MRI

@rtyler rtyler closed this as completed Aug 7, 2015
@enebo enebo added this to the JRuby 1.7.13 milestone Aug 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants