3 ms·
Even the original solution is a lot more complex than just checking some primitive value. A lock is still needed when doing concurrency on a single thread, whic
by nitely 7y ago
Even the original solution is a lot more complex than just checking some primitive value. A lock is still needed when doing concurrency on a single thread, which is the point I'm making anyway.
> Long story short: Your problem is with ordering, not locking.
Look up the definition of a concurrency lock.