MCPcopy Create free account
hub / github.com/eggert/tz / rd2wrlock

Function rd2wrlock

localtime.c:1869–1879  ·  view source on GitHub ↗

If THREADED, upgrade a read lock to a write lock. Return 0 on success, a positive errno value otherwise. */

Source from the content-addressed store, hash-verified

1867/* If THREADED, upgrade a read lock to a write lock.
1868 Return 0 on success, a positive errno value otherwise. */
1869static int
1870rd2wrlock(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,

Callers 1

tzset_unlockedFunction · 0.85

Calls 1

dounlockFunction · 0.85

Tested by

no test coverage detected