by FullyFunctional · 7y ago · 0 comments
The variable `count` appears to be incremented non-atomically from two different threads. Is that safe in C++?
count++;
pthread_mutex_lock(&m);
since the reader already holds the mutex while reading `count`.Note it was a question. As you mention, not everyone can do so (etc).