Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#646 Add volatile where required for double checked locking
Without volatile we can have the situation where thread 2 sees the value of initPending to be false and thus doesn't go through the synced section but sees loggers as not yet visible. This was rare and the test only failed on the first run on my machine before always passing. Hopefully, it should always work now. Fingers crossed. NOTE: Both of the changed classes use a version of the "double checked locking" pattern which the internet says requires volatile.
- Loading branch information