pthread_rwlock_rdlock may fail if the maximum number of read locks (implementation defined) for the lock has been exceeded.
如果超过了最大读锁数量(由实现定义),pthread_rwlock_rdlock 可能会失败。
2
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.
相反地,如果能够获得互斥型锁,那么并发应用程序就无法访问文件,并因为锁超时失败。
3
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).