3 ms·
This. Plus, using a mutex requires that you obtain all your locks in a consistent order, etc. which opens up a whole can of concurrency worms. All you need is
by madmax96 10y ago
This.
Plus, using a mutex requires that you obtain all your locks in a consistent order, etc. which opens up a whole can of concurrency worms. All you need is some intern who didn't properly read the documentation writing code that could deadlock. Atomic access is usually what you want.