Compare commits
1 commit
d9089c4348
...
e9b4f8e389
Author | SHA1 | Date | |
---|---|---|---|
e9b4f8e389 |
1 changed files with 2 additions and 1 deletions
3
main.cpp
3
main.cpp
|
@ -56,9 +56,10 @@ void *thread_task_increment(const struct thread_data &thread) {
|
|||
{
|
||||
|
||||
// tell the thread manager we want the mutex
|
||||
while (!*thread.manager_took_mutex)
|
||||
(*thread.wants_mutex) = true;
|
||||
// block until we have the mutex
|
||||
while (!*thread.has_mutex && *thread.manager_took_mutex)
|
||||
while (!*thread.has_mutex)
|
||||
;
|
||||
|
||||
// enter the mutex
|
||||
|
|
Loading…
Add table
Reference in a new issue