pthread_rwlock_rdlock may fail if the maximum number of read locks (implementation defined) for the lock has been exceeded.
如果超过了最大读锁数量(由实现定义),pthread_rwlock_rdlock 可能会失败。
Conversely, if an exclusive lock was able to be acquired, concurrent applications would not be able to access the file and could fail with a lock time-out.
相反地,如果能够获得互斥型锁,那么并发应用程序就无法访问文件,并因为锁超时失败。
And you should never unlock a mutex that you don't hold a lock for (otherwise, the pthread_mutex_unlock call will fail with a non-zero EPERM return value).
并且绝对不要对您未保持锁的互斥对象进行解锁操作(否则,pthread _ mutex_unlock调用将失败并带一个非零的eperm返回值)。
应用推荐