pthread_rwlock_unlock () 函数释放读或写锁定对象。 如果一个或多个线程正在等待锁定 rwlock ,那么 pthread_rwlock_unlock () 会导致其中一个或多个线程从 pthread_rwlock_rdlock () 或 pthread_rwlock_wrlock () 调用返回,并获取读或写锁定对象。 如果在rwlock上为读锁定和写锁定都阻塞了多个线程,那么z/OS ...
正常に実行された場合、pthread_rwlock_wrlock() は 0 を戻します。 正常に実行されなかった場合、pthread_rwlock_wrlock() は -1 を戻して、errno を次のいずれかの値に設定します。 エラー・コード 説明 EDEADLK 現行スレッドは既に書き込み用または読み取り用に読み取りまたは書き...
#define _OPEN_THREADS #include <pthread.h> int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); SUSV3: #define _UNIX03_THREADS #include <pthread.h> int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock); General description The pthread_rwlock_wrlock() function applies a write lock...
#include <pthread.h> int pthread_rwlock_destroy(pthread_rwlock_t *rwlock); Service Program Name: QP0WPTHR Default Public Authority: *USE Threadsafe: Yes Signal Safe: YesThe pthread_rwlock_destroy() function destroys the named read/write lock. The destroyed read/write lock can no longer be...
#include <pthread.h> int pthread_rwlock_setname_np(pthread_rwlock_t *rwlock, const char *name); Service Program Name: QP0WPTHR Default Public Authority: *USE Threadsafe: Yes Signal Safe: Yes Thepthread_rwlock_setname_np()function sets the name of the read/write lock specified byrwlock. ...
#include <pthread.h> int pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr); Service Program Name: QP0WPTHR Default Public Authority: *USE Threadsafe: Yes Signal Safe: Yes Thepthread_rwlock_init() function initializes a new read/write lock with the specified at...
lock */ rc = pthread_rwlockattr_init(&rwlattr); checkResults("pthread_rwlockattr_init()\n", rc); rc = pthread_rwlockattr_setpshared(&rwlattr, PTHREAD_PROCESS_SHARED); checkResults("pthread_rwlockattr_setpshared()\n", rc); rc = pthread_rwlock_init(&sharedMem->rwlock, &rwlattr); ...
pthread_rwlock_wrlock () 函数将写锁定应用于 rwlock引用的读或写锁定。 如果没有其他线程 (阅读器或写程序) 持有读或写锁定 rwlock,那么调用线程将获取写锁定。 否则,线程块 (即,不会从 pthread_rwlock_wrlock () 调用返回) ,直到它可以获取锁定为止。 在 z/OS UNIX 中,当写程序未持有锁定并且有写...
pthread_rwlock_rdlock () 函数将读锁定应用于 rwlock引用的读或写锁定。 如果写程序未持有该锁,并且该锁上没有被阻止的写程序,那么调用线程将获取读锁。 在 z/OS UNIX中,当写程序未持有该锁定并且有写程序等待该锁定时,调用线程不会获取该锁定,除非该线程已持有 rwlock 以供读取。 它将阻塞并等待直到没有写...
正常に実行された場合、pthread_rwlock_wrlock() は 0 を戻します。 正常に実行されなかった場合、pthread_rwlock_wrlock() は -1 を戻して、errno を次のいずれかの値に設定します。 エラー・コード 説明 EDEADLK 現行スレッドは既に書き込み用または読み取り用に読み取りまたは書き...