| 795 | |
| 796 | #if HAS_PTHREAD_MUTEX_TIMEDLOCK |
| 797 | BUTIL_FORCE_INLINE int pthread_mutex_lock_internal(pthread_mutex_t* mutex, |
| 798 | const struct timespec* abstime) { |
| 799 | int rc = 0; |
| 800 | if (NULL == abstime) { |
| 801 | FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex); |
| 802 | SYS_PTHREAD_MUTEX_CHECK_OWNER; |
| 803 | rc = sys_pthread_mutex_lock(mutex); |
| 804 | if (0 == rc) { |
| 805 | SYS_PTHREAD_MUTEX_SET_OWNER; |
| 806 | } |
| 807 | } else { |
| 808 | rc = sys_pthread_mutex_timedlock(mutex, abstime); |
| 809 | if (0 == rc) { |
| 810 | FIND_SYS_PTHREAD_MUTEX_OWNER_MAP_ENTRY(mutex); |
| 811 | SYS_PTHREAD_MUTEX_SET_OWNER; |
| 812 | } |
| 813 | } |
| 814 | if (0 == rc) { |
| 815 | ADD_TLS_PTHREAD_LOCK_COUNT; |
| 816 | } |
| 817 | return rc; |
| 818 | } |
| 819 | #else |
| 820 | BUTIL_FORCE_INLINE int pthread_mutex_lock_internal(pthread_mutex_t* mutex, |
| 821 | const struct timespec*/* Not supported */) { |
no test coverage detected