libc-lock.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019:
020: #ifndef _BITS_LIBC_LOCK_H
021: #define _BITS_LIBC_LOCK_H 1
022:
023: #include <pthread.h>
024: #define __need_NULL
025: #include <stddef.h>
026:
027:
028:
029:
030:
031:
032:
033:
034: #ifdef _LIBC
035: # include <lowlevellock.h>
036: # include <tls.h>
037: # include <pthread-functions.h>
038: # include <errno.h>
039: # include <gnu/option-groups.h>
040: #endif
041:
042:
043: #if defined _LIBC || defined _IO_MTSAFE_IO
044: # if (defined NOT_IN_libc && !defined IS_IN_libpthread) || !defined _LIBC
045: typedef pthread_mutex_t __libc_lock_t;
046: typedef struct { pthread_mutex_t mutex; } __libc_lock_recursive_t;
047: # else
048: typedef int __libc_lock_t;
049: typedef struct { int lock; int cnt; void *owner; } __libc_lock_recursive_t;
050: # endif
051: typedef struct { pthread_mutex_t mutex; } __rtld_lock_recursive_t;
052: # ifdef __USE_UNIX98
053: typedef pthread_rwlock_t __libc_rwlock_t;
054: # else
055: typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
056: # endif
057: #else
058: typedef struct __libc_lock_opaque__ __libc_lock_t;
059: typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
060: typedef struct __libc_rwlock_opaque__ __libc_rwlock_t;
061: #endif
062:
063:
064: typedef pthread_key_t __libc_key_t;
065:
066:
067:
068:
069:
070:
071:
072:
073: #define __libc_lock_define(CLASS,NAME) \
074: CLASS __libc_lock_t NAME;
075: #define __libc_rwlock_define(CLASS,NAME) \
076: CLASS __libc_rwlock_t NAME;
077: #define __libc_lock_define_recursive(CLASS,NAME) \
078: CLASS __libc_lock_recursive_t NAME;
079: #define __rtld_lock_define_recursive(CLASS,NAME) \
080: CLASS __rtld_lock_recursive_t NAME;
081:
082:
083:
084:
085:
086:
087:
088:
089:
090:
091: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
092: # if LLL_LOCK_INITIALIZER == 0
093: # define __libc_lock_define_initialized(CLASS,NAME) \
094: CLASS __libc_lock_t NAME;
095: # else
096: # define __libc_lock_define_initialized(CLASS,NAME) \
097: CLASS __libc_lock_t NAME = LLL_LOCK_INITIALIZER;
098: # endif
099: #else
100: # if __LT_SPINLOCK_INIT == 0
101: # define __libc_lock_define_initialized(CLASS,NAME) \
102: CLASS __libc_lock_t NAME;
103: # else
104: # define __libc_lock_define_initialized(CLASS,NAME) \
105: CLASS __libc_lock_t NAME = PTHREAD_MUTEX_INITIALIZER;
106: # endif
107: #endif
108:
109: #define __libc_rwlock_define_initialized(CLASS,NAME) \
110: CLASS __libc_rwlock_t NAME = PTHREAD_RWLOCK_INITIALIZER;
111:
112:
113:
114: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
115: # if LLL_LOCK_INITIALIZER == 0
116: # define __libc_lock_define_initialized_recursive(CLASS,NAME) \
117: CLASS __libc_lock_recursive_t NAME;
118: # else
119: # define __libc_lock_define_initialized_recursive(CLASS,NAME) \
120: CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
121: # endif
122: # define _LIBC_LOCK_RECURSIVE_INITIALIZER \
123: { LLL_LOCK_INITIALIZER, 0, NULL }
124: #else
125: # define __libc_lock_define_initialized_recursive(CLASS,NAME) \
126: CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
127: # define _LIBC_LOCK_RECURSIVE_INITIALIZER \
128: {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
129: #endif
130:
131: #define __rtld_lock_define_initialized_recursive(CLASS,NAME) \
132: CLASS __rtld_lock_recursive_t NAME = _RTLD_LOCK_RECURSIVE_INITIALIZER;
133: #define _RTLD_LOCK_RECURSIVE_INITIALIZER \
134: {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
135:
136: #define __rtld_lock_initialize(NAME) \
137: (void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER)
138:
139:
140:
141:
142:
143:
144: #ifdef __PIC__
145: # define __libc_maybe_call(FUNC, ARGS, ELSE) \
146: (__extension__ ({ __typeof (FUNC) *_fn = (FUNC); \
147: _fn != NULL ? (*_fn) ARGS : ELSE; }))
148: #else
149: # define __libc_maybe_call(FUNC, ARGS, ELSE) \
150: (FUNC != NULL ? FUNC ARGS : ELSE)
151: #endif
152:
153:
154: #if defined SHARED && !defined NOT_IN_libc
155: # define PTFAVAIL(NAME) __libc_pthread_functions_init
156: # define __libc_ptf_call(FUNC, ARGS, ELSE) \
157: (__libc_pthread_functions_init ? PTHFCT_CALL (ptr_##FUNC, ARGS) : ELSE)
158: # define __libc_ptf_call_always(FUNC, ARGS) \
159: PTHFCT_CALL (ptr_##FUNC, ARGS)
160: #else
161: # define PTFAVAIL(NAME) (NAME != NULL)
162: # define __libc_ptf_call(FUNC, ARGS, ELSE) \
163: __libc_maybe_call (FUNC, ARGS, ELSE)
164: # define __libc_ptf_call_always(FUNC, ARGS) \
165: FUNC ARGS
166: #endif
167:
168:
169:
170:
171: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
172: # define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
173: #else
174: # define __libc_lock_init(NAME) \
175: __libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
176: #endif
177: #if defined SHARED && !defined NOT_IN_libc
178:
179:
180: # define __libc_rwlock_init(NAME) \
181: (__builtin_memset (&(NAME), '\0', sizeof (NAME)), 0)
182: #else
183: # define __libc_rwlock_init(NAME) \
184: __libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0)
185: #endif
186:
187:
188: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
189: # define __libc_lock_init_recursive(NAME) \
190: ((NAME) = (__libc_lock_recursive_t) _LIBC_LOCK_RECURSIVE_INITIALIZER, 0)
191: #else
192: # define __libc_lock_init_recursive(NAME) \
193: do { \
194: if (__pthread_mutex_init != NULL) \
195: { \
196: pthread_mutexattr_t __attr; \
197: __pthread_mutexattr_init (&__attr); \
198: __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
199: __pthread_mutex_init (&(NAME).mutex, &__attr); \
200: __pthread_mutexattr_destroy (&__attr); \
201: } \
202: } while (0)
203: #endif
204:
205: #define __rtld_lock_init_recursive(NAME) \
206: do { \
207: if (__pthread_mutex_init != NULL) \
208: { \
209: pthread_mutexattr_t __attr; \
210: __pthread_mutexattr_init (&__attr); \
211: __pthread_mutexattr_settype (&__attr, PTHREAD_MUTEX_RECURSIVE_NP); \
212: __pthread_mutex_init (&(NAME).mutex, &__attr); \
213: __pthread_mutexattr_destroy (&__attr); \
214: } \
215: } while (0)
216:
217:
218:
219:
220: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
221: # define __libc_lock_fini(NAME) ((void) 0)
222: #else
223: # define __libc_lock_fini(NAME) \
224: __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
225: #endif
226: #if defined SHARED && !defined NOT_IN_libc
227: # define __libc_rwlock_fini(NAME) ((void) 0)
228: #else
229: # define __libc_rwlock_fini(NAME) \
230: __libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0)
231: #endif
232:
233:
234: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
235: # define __libc_lock_fini_recursive(NAME) ((void) 0)
236: #else
237: # define __libc_lock_fini_recursive(NAME) \
238: __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
239: #endif
240:
241:
242: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
243: # if __OPTION_EGLIBC_BIG_MACROS != 1
244:
245:
246:
247: extern void __libc_lock_lock_fn (__libc_lock_t *);
248: libc_hidden_proto (__libc_lock_lock_fn);
249: # endif
250: # if __OPTION_EGLIBC_BIG_MACROS
251: # define __libc_lock_lock(NAME) \
252: ({ lll_lock (NAME, LLL_PRIVATE); 0; })
253: # else
254: # define __libc_lock_lock(NAME) \
255: __libc_lock_lock_fn (&(NAME))
256: # endif
257: #else
258: # define __libc_lock_lock(NAME) \
259: __libc_maybe_call (__pthread_mutex_lock, (&(NAME)), 0)
260: #endif
261: #define __libc_rwlock_rdlock(NAME) \
262: __libc_ptf_call (__pthread_rwlock_rdlock, (&(NAME)), 0)
263: #define __libc_rwlock_wrlock(NAME) \
264: __libc_ptf_call (__pthread_rwlock_wrlock, (&(NAME)), 0)
265:
266:
267: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
268: # if __OPTION_EGLIBC_BIG_MACROS != 1
269:
270:
271:
272: extern void __libc_lock_lock_recursive_fn (__libc_lock_recursive_t *);
273: libc_hidden_proto (__libc_lock_lock_recursive_fn);
274: # endif
275: # if __OPTION_EGLIBC_BIG_MACROS
276: # define __libc_lock_lock_recursive(NAME) \
277: do { \
278: void *self = THREAD_SELF; \
279: if ((NAME).owner != self) \
280: { \
281: lll_lock ((NAME).lock, LLL_PRIVATE); \
282: (NAME).owner = self; \
283: } \
284: ++(NAME).cnt; \
285: } while (0)
286: # else
287: # define __libc_lock_lock_recursive(NAME) \
288: __libc_lock_lock_recursive_fn (&(NAME))
289: # endif
290: #else
291: # define __libc_lock_lock_recursive(NAME) \
292: __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
293: #endif
294:
295:
296: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
297: # if __OPTION_EGLIBC_BIG_MACROS != 1
298:
299:
300:
301: extern int __libc_lock_trylock_fn (__libc_lock_t *);
302: libc_hidden_proto (__libc_lock_trylock_fn);
303: # endif
304: # if __OPTION_EGLIBC_BIG_MACROS
305: # define __libc_lock_trylock(NAME) \
306: lll_trylock (NAME)
307: # else
308: # define __libc_lock_trylock(NAME) \
309: __libc_lock_trylock_fn (&(NAME))
310: # endif
311: #else
312: # define __libc_lock_trylock(NAME) \
313: __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
314: #endif
315: #define __libc_rwlock_tryrdlock(NAME) \
316: __libc_maybe_call (__pthread_rwlock_tryrdlock, (&(NAME)), 0)
317: #define __libc_rwlock_trywrlock(NAME) \
318: __libc_maybe_call (__pthread_rwlock_trywrlock, (&(NAME)), 0)
319:
320:
321: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
322: # if __OPTION_EGLIBC_BIG_MACROS != 1
323:
324:
325:
326: extern int __libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *);
327: libc_hidden_proto (__libc_lock_trylock_recursive_fn);
328: # endif
329: # if __OPTION_EGLIBC_BIG_MACROS
330: # define __libc_lock_trylock_recursive(NAME) \
331: ({ \
332: int result = 0; \
333: void *self = THREAD_SELF; \
334: if ((NAME).owner != self) \
335: { \
336: if (lll_trylock ((NAME).lock) == 0) \
337: { \
338: (NAME).owner = self; \
339: (NAME).cnt = 1; \
340: } \
341: else \
342: result = EBUSY; \
343: } \
344: else \
345: ++(NAME).cnt; \
346: result; \
347: })
348: # else
349: # define __libc_lock_trylock_recursive(NAME) \
350: __libc_lock_trylock_recursive_fn (&(NAME))
351: # endif
352: #else
353: # define __libc_lock_trylock_recursive(NAME) \
354: __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
355: #endif
356:
357: #define __rtld_lock_trylock_recursive(NAME) \
358: __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
359:
360:
361: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
362: # if __OPTION_EGLIBC_BIG_MACROS != 1
363:
364:
365:
366: extern void __libc_lock_unlock_fn (__libc_lock_t *);
367: libc_hidden_proto (__libc_lock_unlock_fn);
368: # endif
369: # if __OPTION_EGLIBC_BIG_MACROS
370: # define __libc_lock_unlock(NAME) \
371: lll_unlock (NAME, LLL_PRIVATE)
372: # else
373: # define __libc_lock_unlock(NAME) \
374: __libc_lock_unlock_fn (&(NAME))
375: # endif
376: #else
377: # define __libc_lock_unlock(NAME) \
378: __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
379: #endif
380: #define __libc_rwlock_unlock(NAME) \
381: __libc_ptf_call (__pthread_rwlock_unlock, (&(NAME)), 0)
382:
383:
384: #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
385: # if __OPTION_EGLIBC_BIG_MACROS != 1
386:
387:
388:
389: extern void __libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *);
390: libc_hidden_proto (__libc_lock_unlock_recursive_fn);
391: # endif
392: # if __OPTION_EGLIBC_BIG_MACROS
393:
394: # define __libc_lock_unlock_recursive(NAME) \
395: do { \
396: if (--(NAME).cnt == 0) \
397: { \
398: (NAME).owner = NULL; \
399: lll_unlock ((NAME).lock, LLL_PRIVATE); \
400: } \
401: } while (0)
402: # else
403: # define __libc_lock_unlock_recursive(NAME) \
404: __libc_lock_unlock_recursive_fn (&(NAME))
405: # endif
406: #else
407: # define __libc_lock_unlock_recursive(NAME) \
408: __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
409: #endif
410:
411: #if defined _LIBC && defined SHARED
412: # define __rtld_lock_default_lock_recursive(lock) \
413: ++((pthread_mutex_t *)(lock))->__data.__count;
414:
415: # define __rtld_lock_default_unlock_recursive(lock) \
416: --((pthread_mutex_t *)(lock))->__data.__count;
417:
418: # define __rtld_lock_lock_recursive(NAME) \
419: GL(dl_rtld_lock_recursive) (&(NAME).mutex)
420:
421: # define __rtld_lock_unlock_recursive(NAME) \
422: GL(dl_rtld_unlock_recursive) (&(NAME).mutex)
423: #else
424: # define __rtld_lock_lock_recursive(NAME) \
425: __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
426:
427: # define __rtld_lock_unlock_recursive(NAME) \
428: __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
429: #endif
430:
431:
432: #if PTHREAD_ONCE_INIT == 0
433:
434:
435: # define __libc_once_define(CLASS, NAME) \
436: CLASS pthread_once_t NAME
437: #else
438: # define __libc_once_define(CLASS, NAME) \
439: CLASS pthread_once_t NAME = PTHREAD_ONCE_INIT
440: #endif
441:
442:
443: #define __libc_once(ONCE_CONTROL, INIT_FUNCTION) \
444: do { \
445: if (PTFAVAIL (__pthread_once)) \
446: __libc_ptf_call_always (__pthread_once, (&(ONCE_CONTROL), \
447: INIT_FUNCTION)); \
448: else if ((ONCE_CONTROL) == PTHREAD_ONCE_INIT) { \
449: INIT_FUNCTION (); \
450: (ONCE_CONTROL) |= 2; \
451: } \
452: } while (0)
453:
454:
455:
456:
457:
458:
459: extern void _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
460: void (*routine) (void *), void *arg);
461: extern void _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer,
462: int execute);
463: extern void _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer,
464: void (*routine) (void *), void *arg);
465: extern void _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer,
466: int execute);
467:
468:
469: #define __libc_cleanup_region_start(DOIT, FCT, ARG) \
470: { struct _pthread_cleanup_buffer _buffer; \
471: int _avail; \
472: if (DOIT) { \
473: _avail = PTFAVAIL (_pthread_cleanup_push_defer); \
474: if (_avail) { \
475: __libc_ptf_call_always (_pthread_cleanup_push_defer, (&_buffer, FCT, \
476: ARG)); \
477: } else { \
478: _buffer.__routine = (FCT); \
479: _buffer.__arg = (ARG); \
480: } \
481: } else { \
482: _avail = 0; \
483: }
484:
485:
486: #define __libc_cleanup_region_end(DOIT) \
487: if (_avail) { \
488: __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\
489: } else if (DOIT) \
490: _buffer.__routine (_buffer.__arg); \
491: }
492:
493:
494: #define __libc_cleanup_end(DOIT) \
495: if (_avail) { \
496: __libc_ptf_call_always (_pthread_cleanup_pop_restore, (&_buffer, DOIT));\
497: } else if (DOIT) \
498: _buffer.__routine (_buffer.__arg)
499:
500:
501:
502: __extern_inline void
503: __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
504: {
505: if (f->__do_it)
506: f->__cancel_routine (f->__cancel_arg);
507: }
508:
509: #define __libc_cleanup_push(fct, arg) \
510: do { \
511: struct __pthread_cleanup_frame __clframe \
512: __attribute__ ((__cleanup__ (__libc_cleanup_routine))) \
513: = { .__cancel_routine = (fct), .__cancel_arg = (arg), \
514: .__do_it = 1 };
515:
516: #define __libc_cleanup_pop(execute) \
517: __clframe.__do_it = (execute); \
518: } while (0)
519:
520:
521:
522: #define __libc_key_create(KEY, DESTRUCTOR) \
523: __libc_ptf_call (__pthread_key_create, (KEY, DESTRUCTOR), 1)
524:
525:
526: #define __libc_getspecific(KEY) \
527: __libc_ptf_call (__pthread_getspecific, (KEY), NULL)
528:
529:
530: #define __libc_setspecific(KEY, VALUE) \
531: __libc_ptf_call (__pthread_setspecific, (KEY, VALUE), 0)
532:
533:
534:
535:
536:
537: #define __libc_atfork(PREPARE, PARENT, CHILD) \
538: __register_atfork (PREPARE, PARENT, CHILD, NULL)
539: extern int __register_atfork (void (*__prepare) (void),
540: void (*__parent) (void),
541: void (*__child) (void),
542: void *__dso_handle);
543:
544:
545:
546:
547: extern int __pthread_mutex_init (pthread_mutex_t *__mutex,
548: __const pthread_mutexattr_t *__mutex_attr);
549:
550: extern int __pthread_mutex_destroy (pthread_mutex_t *__mutex);
551:
552: extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex);
553:
554: extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
555:
556: extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
557:
558: extern int __pthread_mutexattr_init (pthread_mutexattr_t *__attr);
559:
560: extern int __pthread_mutexattr_destroy (pthread_mutexattr_t *__attr);
561:
562: extern int __pthread_mutexattr_settype (pthread_mutexattr_t *__attr,
563: int __kind);
564:
565: #ifdef __USE_UNIX98
566: extern int __pthread_rwlock_init (pthread_rwlock_t *__rwlock,
567: __const pthread_rwlockattr_t *__attr);
568:
569: extern int __pthread_rwlock_destroy (pthread_rwlock_t *__rwlock);
570:
571: extern int __pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock);
572:
573: extern int __pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock);
574:
575: extern int __pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock);
576:
577: extern int __pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock);
578:
579: extern int __pthread_rwlock_unlock (pthread_rwlock_t *__rwlock);
580: #endif
581:
582: extern int __pthread_key_create (pthread_key_t *__key,
583: void (*__destr_function) (void *));
584:
585: extern int __pthread_setspecific (pthread_key_t __key,
586: __const void *__pointer);
587:
588: extern void *__pthread_getspecific (pthread_key_t __key);
589:
590: extern int __pthread_once (pthread_once_t *__once_control,
591: void (*__init_routine) (void));
592:
593: extern int __pthread_atfork (void (*__prepare) (void),
594: void (*__parent) (void),
595: void (*__child) (void));
596:
597:
598:
599:
600:
601: #ifndef __NO_WEAK_PTHREAD_ALIASES
602: # ifdef weak_extern
603: # if _LIBC
604: # include <bp-sym.h>
605: # else
606: # define BP_SYM(sym) sym
607: # endif
608: weak_extern (BP_SYM (__pthread_mutex_init))
609: weak_extern (BP_SYM (__pthread_mutex_destroy))
610: weak_extern (BP_SYM (__pthread_mutex_lock))
611: weak_extern (BP_SYM (__pthread_mutex_trylock))
612: weak_extern (BP_SYM (__pthread_mutex_unlock))
613: weak_extern (BP_SYM (__pthread_mutexattr_init))
614: weak_extern (BP_SYM (__pthread_mutexattr_destroy))
615: weak_extern (BP_SYM (__pthread_mutexattr_settype))
616: weak_extern (BP_SYM (__pthread_rwlock_init))
617: weak_extern (BP_SYM (__pthread_rwlock_destroy))
618: weak_extern (BP_SYM (__pthread_rwlock_rdlock))
619: weak_extern (BP_SYM (__pthread_rwlock_tryrdlock))
620: weak_extern (BP_SYM (__pthread_rwlock_wrlock))
621: weak_extern (BP_SYM (__pthread_rwlock_trywrlock))
622: weak_extern (BP_SYM (__pthread_rwlock_unlock))
623: weak_extern (BP_SYM (__pthread_key_create))
624: weak_extern (BP_SYM (__pthread_setspecific))
625: weak_extern (BP_SYM (__pthread_getspecific))
626: weak_extern (BP_SYM (__pthread_once))
627: weak_extern (__pthread_initialize)
628: weak_extern (__pthread_atfork)
629: weak_extern (BP_SYM (_pthread_cleanup_push_defer))
630: weak_extern (BP_SYM (_pthread_cleanup_pop_restore))
631: weak_extern (BP_SYM (pthread_setcancelstate))
632: # else
633: # pragma weak __pthread_mutex_init
634: # pragma weak __pthread_mutex_destroy
635: # pragma weak __pthread_mutex_lock
636: # pragma weak __pthread_mutex_trylock
637: # pragma weak __pthread_mutex_unlock
638: # pragma weak __pthread_mutexattr_init
639: # pragma weak __pthread_mutexattr_destroy
640: # pragma weak __pthread_mutexattr_settype
641: # pragma weak __pthread_rwlock_destroy
642: # pragma weak __pthread_rwlock_rdlock
643: # pragma weak __pthread_rwlock_tryrdlock
644: # pragma weak __pthread_rwlock_wrlock
645: # pragma weak __pthread_rwlock_trywrlock
646: # pragma weak __pthread_rwlock_unlock
647: # pragma weak __pthread_key_create
648: # pragma weak __pthread_setspecific
649: # pragma weak __pthread_getspecific
650: # pragma weak __pthread_once
651: # pragma weak __pthread_initialize
652: # pragma weak __pthread_atfork
653: # pragma weak _pthread_cleanup_push_defer
654: # pragma weak _pthread_cleanup_pop_restore
655: # pragma weak pthread_setcancelstate
656: # endif
657: #endif
658:
659: #endif
660:
© Andrew Scott 2006 -
2025,
All Rights Reserved