Introduction
This is the other thread safe pattern. In this example, user cannot enter the thread safe region within the same thread more than 1 time.
Code
Result
You may find the following logging example showing that the program is in a deadlock due to a thread safe region re-entry attempt within the same thread.
$ ./app/DefaultMutexLinux/DefaultMutexLinux
count: 0
^C


Comments
Post a Comment