mirror of https://github.com/mkerrisk/man-pages
pthread_mutexattr_setrobust.3: EXAMPLE: show example run of program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
f6569f44bd
commit
8524bca574
|
@ -184,6 +184,20 @@ The main thread subsequently acquires the mutex
|
|||
successfully and gets the error
|
||||
.BR EOWNERDEAD ,
|
||||
after which it makes the mutex consistent.
|
||||
.PP
|
||||
The following shell session shows what we see when running this program:
|
||||
.PP
|
||||
.in +4n
|
||||
.EX
|
||||
$ \fB./a.out\fP
|
||||
[original owner] Setting lock...
|
||||
[original owner] Locked. Now exiting without unlocking.
|
||||
[main thread] Attempting to lock the robust mutex.
|
||||
[main thread] pthread_mutex_lock() returned EOWNERDEAD
|
||||
[main thread] Now make the mutex consistent
|
||||
[main thread] Mutex is now consistent; unlocking
|
||||
.EE
|
||||
.in
|
||||
.SS Program source
|
||||
.EX
|
||||
#include <stdlib.h>
|
||||
|
|
Loading…
Reference in New Issue