📄 pthread_rwlock_unlock.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>pthread_rwlock_unlock</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_007_1621"> </a>NAME</h4><blockquote>pthread_rwlock_unlock - unlock a read-write lock object</blockquote><h4><a name = "tag_000_007_1622"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="pthread.h.html">pthread.h</a>>int pthread_rwlock_unlock(pthread_rwlock_t <i>*rwlock</i>);</code></pre></blockquote><h4><a name = "tag_000_007_1623"> </a>DESCRIPTION</h4><blockquote>The<i>pthread_rwlock_unlock()</i>function is called to release a lock held on the read-write lockobject referenced by <i>rwlock</i>.Results are undefined if the read-write lock <i>rwlock</i> is notheld by the calling thread.<p>If this function is called to release a read lock from theread-write lock object and there are other read lockscurrently held on this read-write lock object, the read-writelock object remains in the read locked state.If this function releases the calling thread's last read lock on thisread-write lock object, then the calling thread is no longer one ofthe owners of the object.If this function releases the last read lock for this read-write lockobject, the read-write lock object will be put in the unlocked statewith no owners.<p>If this function is called to release a write lock for thisread-write lock object, the read-write lock object willbe put in the unlocked state with no owners.<p>If the call to the <i>pthread_rwlock_unlock()</i>function results inthe read-write lock object becoming unlockedand there are multiple threads waiting to acquire the read-writelock object for writing, the scheduling policyis used to determine which thread acquires the read-writelock object for writing. If there are multiplethreads waiting to acquire the read-write lock object for reading,the scheduling policy is used to determinethe order in which the waiting threads acquire theread-write lock object for reading. If there are multiple threads blocked on <i>rwlock</i>for both read locks and write locks, it isunspecified whether the readers acquire the lock first or whethera writer acquires the lock first.<p>Results are undefined if any of these functions are called withan uninitialised read-write lock.</blockquote><h4><a name = "tag_000_007_1624"> </a>RETURN VALUE</h4><blockquote>If successful, the <i>pthread_rwlock_unlock()</i>function returns zero.Otherwise, an error number is returnedto indicate the error.</blockquote><h4><a name = "tag_000_007_1625"> </a>ERRORS</h4><blockquote>The<i>pthread_rwlock_unlock()</i>function may fail if:<dl compact><dt>[EINVAL]<dd>The value specified by <i>rwlock</i> does not refer to an initialisedread-write lock object.<dt>[EPERM]<dd>The current thread does not own the read-write lock.</dl></blockquote><h4><a name = "tag_000_007_1626"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1627"> </a>APPLICATION USAGE</h4><blockquote>Similar functions are being developed by IEEE PASC.In keeping with its objective of ensuring that CAESpecifications are fully aligned with formal standards, The Open Groupintends to add any new interfaces adopted by an official IEEE standardin this area.</blockquote><h4><a name = "tag_000_007_1628"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_007_1629"> </a>SEE ALSO</h4><blockquote><i><a href="pthread.h.html"><pthread.h></a></i>,<i><a href="pthread_rwlock_init.html">pthread_rwlock_init()</a></i>,<i><a href="pthread_rwlock_wrlock.html">pthread_rwlock_wrlock()</a></i>,<i><a href="pthread_rwlockattr_init.html">pthread_rwlockattr_init()</a></i>,<i><a href="pthread_rwlock_rdlock.html">pthread_rwlock_rdlock()</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -