diff options
author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-09-30 12:01:52 +0000 |
---|---|---|
committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2015-09-30 12:01:52 +0000 |
commit | 160740c3ccd45d992c559f0cb51f9f70e98ad8d0 (patch) | |
tree | 2299af6115426d5f97c60882b97a5180490a039d /usr/src/man/man3c/mutex_init.3c | |
parent | 6f40e38fe79ea829e8803cbb6d68ed166db541c7 (diff) | |
parent | adb26135f9399e574196b45d6ab3ba1bb470e60f (diff) | |
download | illumos-joyent-160740c3ccd45d992c559f0cb51f9f70e98ad8d0.tar.gz |
[illumos-gate merge]20151001release-20151001
commit adb26135f9399e574196b45d6ab3ba1bb470e60f
4648 detach(9e): Extra space between 'prefix' and 'detach'
commit bcfd4cacb8887a687a4dd27cbaeec75e65f0e9de
5663 sysinfo(2): Missing spaces in the man page
commit 118975ce0091e85fa58568a5700555eec6330843
5678 mutex_init(3C): Extra space in man page
commit ba647289fedd78140d3b8288576aeb23fcf57043
5706 dldump(3c)/dlopen(3c): Extra spaces in the man page
commit 9a91647e0ac8a8e02f9e9d8345e751e0c02c0b19
6050 kstat_create(9f) should document KSTAT_TYPE_RAW and KSTAT_TYPE_TIMER
commit e057ac923deda9b3a28f8ec5b927ccf0a9479ba9
6097 ks_snapshot(9e): Typo in the man page
commit c4921527904c6350c4ac33b0f936c4920cb38d39
5036 taskq(9f): Typos in the man page
commit cebfa3c2fea024bb483d40f6d0cacd3298540cab
5657 Typo in rpcbind(3nsl): ssvcaddr
commit cf6fe0ff9e996915d750fb1fc98477c23e9c5e1d
4514 k5srvutil(1m): The default keytab file is /etc/krb5/krb5.keytab
commit 20110e4e4d2d67b7e7c7309d1733ee00a499c491
5730 Typos in rpc_clnt_create(3nsl) man page
commit 395c7a3dcfc66b8b671dc4b3c4a2f0ca26449922
6266 harden dtrace_difo_chunksize() with respect to malicious DIF
commit 6a9ca708361200b105f7a016216808e6058d17cb
6263 add missing cc clobbers to intel atomic inlines
Diffstat (limited to 'usr/src/man/man3c/mutex_init.3c')
-rw-r--r-- | usr/src/man/man3c/mutex_init.3c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/usr/src/man/man3c/mutex_init.3c b/usr/src/man/man3c/mutex_init.3c index 3a42aee0ec..a9b75a4155 100644 --- a/usr/src/man/man3c/mutex_init.3c +++ b/usr/src/man/man3c/mutex_init.3c @@ -10,7 +10,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] -.TH MUTEX_INIT 3C "Oct 22, 2014" +.TH MUTEX_INIT 3C "Sep 7, 2015" .SH NAME mutex_init, mutex_lock, mutex_trylock, mutex_unlock, mutex_consistent, mutex_destroy \- mutual exclusion locks @@ -21,7 +21,7 @@ cc -mt [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] #include <thread.h> #include <synch.h> -\fBint\fR \fBmutex_init\fR(\fBmutex_t *\fR\fImp\fR, \fBint\fR \fItype\fR, \fBvoid *\fR \fIarg\fR); +\fBint\fR \fBmutex_init\fR(\fBmutex_t *\fR\fImp\fR, \fBint\fR \fItype\fR, \fBvoid *\fR\fIarg\fR); .fi .LP @@ -50,7 +50,6 @@ cc -mt [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ] .fi .SH DESCRIPTION -.sp .LP Mutual exclusion locks (mutexes) prevent multiple threads from simultaneously executing critical sections of code that access shared data (that is, mutexes @@ -66,7 +65,6 @@ Mutexes can be used to synchronize threads between processes if the mutexes are allocated in writable memory and shared among the cooperating processes (see \fBmmap\fR(2)), and have been initialized for this task. .SS "Initialize" -.sp .LP Mutexes are either intra-process or inter-process, depending upon the argument passed implicitly or explicitly to the initialization of that mutex. A @@ -325,7 +323,6 @@ Same as (\fBUSYNC_THREAD\fR | \fBLOCK_RECURSIVE\fR | \fBLOCK_ERRORCHECK\fR) .RE .SS "Lock and Unlock" -.sp .LP A critical section of code is enclosed by a the call to lock the mutex and the call to unlock the mutex to protect it from simultaneous access by multiple @@ -371,18 +368,15 @@ policy will determine which thread gets the mutex. If the calling thread is not the owner of the lock, no error status is returned, and the behavior of the program is undefined. .SS "Destroy" -.sp .LP The \fBmutex_destroy()\fR function destroys the mutex object referenced by \fImp\fR. The mutex object becomes uninitialized. The space used by the destroyed mutex variable is not freed. It needs to be explicitly reclaimed. .SH RETURN VALUES -.sp .LP If successful, these functions return \fB0\fR. Otherwise, an error number is returned. .SH ERRORS -.sp .LP The \fBmutex_init()\fR function will fail if: .sp @@ -535,7 +529,6 @@ having an inconsistent state (\fBEOWNERDEAD\fR). .SH EXAMPLES .SS "Single Gate" -.sp .LP The following example uses one global mutex as a gate-keeper to permit each thread exclusive sequential access to the code within the user-defined @@ -572,7 +565,6 @@ void * change_global_data(void *null){ .in -2 .SS "Multiple Instruction Single Data" -.sp .LP The previous example, the mutex, the code it owns, and the data it protects was enclosed in one function. The next example uses C++ features to accommodate @@ -638,7 +630,6 @@ void * change_global_data(void *) { .in -2 .SS "Interprocess Locking" -.sp .LP A mutex can protect data that is shared among processes. The mutex would need to be initialized as \fBUSYNC_PROCESS\fR. One process initializes the @@ -751,7 +742,6 @@ void test_argv(char argv1[]) { .in -2 .SS "Solaris Interprocess Robust Locking" -.sp .LP A mutex can protect data that is shared among processes robustly. The mutex would need to be initialized as \fBUSYNC_PROCESS\fR | \fBLOCK_ROBUST\fR. One @@ -854,7 +844,6 @@ void create_shared_memory() { .in -2 .SS "Dynamically Allocated Mutexes" -.sp .LP The following example allocates and frees memory in which a mutex is embedded. .sp @@ -913,7 +902,6 @@ free(r); /* then free memory */ .LP If the mutex is not destroyed, the program could have memory leaks. .SH ATTRIBUTES -.sp .LP See \fBattributes\fR(5) for descriptions of the following attributes: .sp @@ -931,7 +919,6 @@ MT-Level MT-Safe .TE .SH SEE ALSO -.sp .LP \fBmmap\fR(2), \fBshmop\fR(2), \fBpthread_mutexattr_getprioceiling\fR(3C), \fBpthread_mutexattr_getprotocol\fR(3C), \fBpthread_mutexattr_getrobust\fR(3C), @@ -939,7 +926,6 @@ MT-Level MT-Safe \fBpthread_mutex_init\fR(3C), \fBattributes\fR(5), \fBmutex\fR(5), \fBstandards\fR(5) .SH NOTES -.sp .LP Previous releases of Solaris provided the \fBUSYNC_PROCESS_ROBUST\fR mutex type. This type is now deprecated but is still supported for source and binary |