1.pthread_cancel函数用来请求取消同一进程中的其他线程,它是非阻塞的。
2.pthread_mutex_trylock试图加锁,失败则会返回EBUSY.
3.pthread_mutex_timedlock试图加锁,超时则会返回ETIMEDOUT.
4.读写锁也叫共享互斥锁。int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const pthread_rwlockattr_t *restrict attr);
5.由于自旋锁使用者一般保持锁时间非常短,因此选择自旋而不是睡眠是非常必要的,自旋锁的效率远高于互斥锁。