1e1f96f73e
Depending on the execution, some accesses to lock could cause NPE. The best solution we've found so far is to make lock volatile, so that reads between lock and value are consistent between threads. It requires further work to determine if we can have one volatile field.