如果调用 pthread_rwlockattr_init () ,指定已初始化的读或写锁定属性对象,那么将拒绝该请求,并且当前锁定属性对象保持不变。 返回值 如果成功, pthread_rwlockattr_init () 将返回 0。 如果失败,那么 pthread_rwlockattr_init () 将返回 -1 并将 errno 设置为下列其中一个值:...
pthread_rwlockattr_init子例程使用实现定义的所有属性的缺省值来初始化读写锁属性对象attr。 如果调用pthread_rwlockattr_init来指定已初始化的读写锁属性对象,那么未定义结果。 在读写锁属性对象被用于初始化一个或多个后,任何影响该属性对象的函数(包括析构函数)不会影响任何以前已初始化的读写锁。
If successful, the pthread_rwlockattr_init() and pthread_rwlockattr_destroy() functions return 0. Otherwise, an error number is returned to indicate the error.ERRORSThe pthread_rwlockattr_init() function will fail if: ENOMEM Insufficient memory exists to initialize the read-write lock attributes...
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ADAPTIVE_NP); pthread_mutex_init(&heap->lock, &attr); pthread_mutexattr_destroy(&attr);pthread_rwlockattr_init(&rwattr); pthread_rwlockattr_setkind_np(&rwattr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); pthread_rwlock_init(&heap->rwlock, ...
This function initializes a read-write lock attributes object specified by rwattr with the default value for all of the attributes. Class Function Argument Type and Attributes rwattr TYPE(f_pthread_rwlockattr_t), INTENT(OUT) Result Type and Attributes INTEGER(4) Result Value On successful comple...