pthread_mutexattr_setrobust.3: EXAMPLE: show example run of program

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2017-09-12 16:58:05 +02:00
parent f6569f44bd
commit 8524bca574
1 changed files with 14 additions and 0 deletions

View File

@ -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>