Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../../../usr/man/man2/_lwp_mutex_lock.2
Real path: /usr/share/man/man2/_lwp_mutex_lock.2
Zurück
'\" te .\" Copyright (c) 1997, 2023, Oracle and/or its affiliates. .TH _lwp_mutex_lock 2 "30 Jan 2023" "Oracle Solaris 11.4" "System Calls" .SH NAME _lwp_mutex_lock, _lwp_mutex_unlock, _lwp_mutex_trylock \- mutual exclusion .SH SYNOPSIS .LP .nf #include <sys/lwp.h> \fBint\fR \fB_lwp_mutex_lock\fR(\fBlwp_mutex_t *\fR\fImp\fR); .fi .LP .nf \fBint\fR \fB_lwp_mutex_trylock\fR(\fBlwp_mutex_t *\fR\fImp\fR); .fi .LP .nf \fBint\fR \fB_lwp_mutex_unlock\fR(\fBlwp_mutex_t *\fR\fImp\fR); .fi .SH DESCRIPTION .sp .LP These functions serialize the execution of lightweight processes. They are useful for ensuring that only one lightweight process can execute a critical section of code at any one time (mutual exclusion). LWP mutexes must be initialized to 0 before use. .sp .LP The \fB_lwp_mutex_lock()\fR function locks the LWP mutex pointed to by \fImp\fR. If the mutex is already locked, the calling LWP blocks until the mutex becomes available. When \fB_lwp_mutex_lock()\fR returns, the mutex is locked and the calling LWP is the "owner". .sp .LP The \fB_lwp_mutex_trylock()\fR function attempts to lock the mutex. If the mutex is already locked it returns with an error. If the mutex is unlocked, it is locked and \fB_lwp_mutex_trylock()\fR returns. .sp .LP The \fB_lwp_mutex_unlock()\fR function unlocks a locked mutex. The mutex must be locked and the calling LWP must be the one that last locked the mutex (the owner). If any other LWPs are waiting for the mutex to become available, one of them is unblocked. .SH RETURN VALUES .sp .LP Upon successful completion, \fB0\fR is returned. A non-zero value indicates an error. .SH ERRORS .sp .LP If any of the following conditions are detected, \fB_lwp_mutex_lock()\fR, \fB_lwp_mutex_trylock()\fR, and \fB_lwp_mutex_unlock()\fR fail and return the corresponding value: .sp .ne 2 .mk .na \fB\fBEINVAL\fR\fR .ad .RS 10n .rt The \fImp\fR argument points to an invalid LWP mutex. .RE .sp .ne 2 .mk .na \fB\fBEFAULT\fR\fR .ad .RS 10n .rt The \fImp\fR argument points to an illegal address. .RE .sp .LP If any of the following conditions occur, \fB_lwp_mutex_trylock()\fR fails and returns the corresponding value: .sp .ne 2 .mk .na \fB\fBEBUSY\fR\fR .ad .RS 9n .rt The \fImp\fR argument points to a locked mutex. .RE .SH USAGE .sp .LP Most software should use the standard interfaces described in the \fBmutex\fR(7) and \fBthreads\fR(7) manual pages instead of these low-level system calls. .SH SEE ALSO .sp .LP \fB_lwp_cond_wait\fR(2), \fBIntro\fR(2), \fBmutex\fR(7), \fBthreads\fR(7) .SH HISTORY .sp .LP The \fB_lwp_mutex_lock()\fR, \fB_lwp_mutex_trylock()\fR, and \fB_lwp_mutex_unlock()\fR functions were added in Solaris 2.2.