'\" te .\" Copyright (c) 2008, IEEE and The Open Group. All Rights Reserved. .\" Portions Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved. .TH pthread_mutex_consistent 3C "5 Jun 2007" "SunOS 5.11" "Standard C Library Functions" .SH NAME pthread_mutex_consistent \- mark state protected by robust mutex as consistent .SH SYNOPSIS .LP .nf cc -mt [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] #include \fBint\fR \fBpthread_mutex_consistent\fR(\fBpthread_mutex_t *\fR\fImutex\fR); .fi .SH DESCRIPTION .sp .LP The following applies only to mutexes that have been initialized with the \fBPTHREAD_MUTEX_ROBUST\fR attribute. See \fBpthread_mutexattr_getrobust\fR(3C). .sp .LP If mutex is a robust mutex in an inconsistent state, the \fBpthread_mutex_consistent()\fR function can be used to mark the state protected by the mutex referenced by mutex as consistent again. .sp .LP If the owner of a robust mutex terminates while holding the mutex, or if the process containing the owner of the mutex unmaps the memory containing the mutex or performs one of the \fBexec\fR(2) functions, the mutex becomes inconsistent and the next thread that acquires the mutex lock is notified of the state by the return value \fBEOWNERDEAD\fR. In this case, the mutex does not become normally usable again until the state is marked consistent. .sp .LP The \fBpthread_mutex_consistent()\fR function is only responsible for notifying the system that the state protected by the mutex has been recovered and that normal operations with the mutex can be resumed. It is the responsibility of the application to recover the state so it can be reused. If the application is not able to perform the recovery, it can notify the system that the situation is unrecoverable by a call to \fBpthread_mutex_unlock\fR(3C) without a prior call to \fBpthread_mutex_consistent()\fR, in which case subsequent threads that attempt to lock the mutex will fail to acquire the lock and be returned \fBENOTRECOVERABLE\fR. .sp .LP If the thread which acquired the mutex lock with the return value \fBEOWNERDEAD\fR terminates before calling either \fBpthread_mutex_consistent()\fR or \fBpthread_mutex_unlock()\fR, the next thread that acquires the mutex lock is notified about the state of the mutex by the return value \fBEOWNERDEAD\fR. .SH RETURN VALUES .sp .LP Upon successful completion, the \fBpthread_mutexattr_consistent()\fR function returns \fB0\fR. Otherwise, an error value is returned to indicate the error. .SH ERRORS .sp .LP The \fBpthread_mutex_consistent()\fR function will fail if: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The current thread does not own the mutex or the mutex is not a \fBPTHREAD_MUTEX_ROBUST\fR mutex having an inconsistent state (\fBEOWNERDEAD\fR). .RE .SH ATTRIBUTES .sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPEATTRIBUTE VALUE _ Interface StabilityCommitted _ StandardSee \fBstandards\fR(5). _ MT-Level MT-Safe .TE .SH SEE ALSO .sp .LP \fBexec\fR(2), \fBpthread_mutex_lock\fR(3C), \fBpthread_mutex_unlock\fR(3C), \fBpthread_mutexattr_getrobust\fR(3C), \fBattributes\fR(5), \fBmutex\fR(5), \fBstandards\fR(5)