benedekh / WeLoveClouds

Repository for submissions on the CloudDB course.
0 stars 1 forks source link

Use java.util.concurrent.locks.Lock instead of custom locking #84

Closed benedekh closed 7 years ago

benedekh commented 7 years ago

in ControllablePersistentStorage.

benedekh commented 7 years ago

For our purposes the flag is a good solution still, because we just want to stop others entering the section as soon as it is forbidden. Since that variable is volatile, every thread will get its latest value.