Good day!
Did the task: it is necessary to synchronize using testAndSet flows:
int atomic testAndSet ( char *lock ) {
char var;
var = *lock;
*lock = 1;
return var;
}
But with a atomic problem, but it does not.
Prompt library for atomic variable in C++?