If THREADED, upgrade a read lock to a write lock. Return 0 on success, a positive errno value otherwise. */
| 1867 | /* If THREADED, upgrade a read lock to a write lock. |
| 1868 | Return 0 on success, a positive errno value otherwise. */ |
| 1869 | static int |
| 1870 | rd2wrlock(ATTRIBUTE_MAYBE_UNUSED bool threaded) |
| 1871 | { |
| 1872 | # if THREAD_RWLOCK |
| 1873 | if (threaded) { |
| 1874 | dounlock(); |
| 1875 | return pthread_rwlock_wrlock(&locallock); |
| 1876 | } |
| 1877 | # endif |
| 1878 | return 0; |
| 1879 | } |
| 1880 | |
| 1881 | /* Like tzset(), but in a critical section. |
| 1882 | If THREADED && THREAD_RWLOCK the caller has a read lock, |
no test coverage detected