3 ms·
When your program is single threaded, a simple boolean flag variable can act as a mutex, you don't need a mutex for this. Mutexes are for situations where flag
by random314 7y ago
When your program is single threaded, a simple boolean flag variable can act as a mutex, you don't need a mutex for this.
Mutexes are for situations where flag variables can change state between your instructions to check and set a flag. This can only happen in multithreaded or interrupt driven code.