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. */
| 104 | If true, it might become false the next time it is called |
| 105 | if all other threads exit in the meantime. */ |
| 106 | static bool |
| 107 | is_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 |
| 119 | static pthread_rwlock_t locallock = PTHREAD_RWLOCK_INITIALIZER; |