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

Fix the race condition of Loader.cacheResource() (issue #182) #188

Merged
merged 2 commits into from Jun 8, 2017

Conversation

mythly
Copy link
Contributor

@mythly mythly commented Jun 5, 2017

See issue #182 for more details.

The fix was manually tested on only linux, as I cannot figure out the proper way to write an unit test, which would need two JVMs.

@saudet
Copy link
Member

saudet commented Jun 6, 2017

Great, thanks! Locks might be expensive though. Maybe we should check the file size, time, and state twice, once before and after locking?

Also, let's name the file ".lock", if that's OK.

@mythly
Copy link
Contributor Author

mythly commented Jun 7, 2017

Good point! I improved the implementation and ensured that locking happens only in the first running.

@saudet saudet merged commit 1797745 into bytedeco:master Jun 8, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants