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

Function is_threaded

localtime.c:106–116  ·  view source on GitHub ↗

True if the current process might be multi-threaded, false if it is definitely single-threaded. If false, it will be false the next time it is called unless the caller creates a thread in the meantime. If true, it might become false the next time it is called if all other threads exit in the meantime. */

Source from the content-addressed store, hash-verified

104 If true, it might become false the next time it is called
105 if all other threads exit in the meantime. */
106static bool
107is_threaded(void)
108{
109# if THREAD_PREFER_SINGLE && HAVE___ISTHREADED
110 return !!__isthreaded;
111# elif THREAD_PREFER_SINGLE && HAVE_SYS_SINGLE_THREADED_H
112 return !__libc_single_threaded;
113# else
114 return true;
115# endif
116}
117
118# if THREAD_RWLOCK
119static pthread_rwlock_t locallock = PTHREAD_RWLOCK_INITIALIZER;

Callers 2

lockFunction · 0.85
tm_multiFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected