Lines Matching refs:thrd
581 #define THR_SHOULD_GC(thrd) \ argument
582 ((thrd)->refcount == 0 && (thrd)->state == PS_DEAD && \
583 ((thrd)->flags & THR_FLAGS_DETACHED) != 0)
585 #define THR_IN_CRITICAL(thrd) \ argument
586 (((thrd)->locklevel > 0) || \
587 ((thrd)->critical_count > 0))
589 #define THR_CRITICAL_ENTER(thrd) \ argument
590 (thrd)->critical_count++
592 #define THR_CRITICAL_LEAVE(thrd) \ argument
594 (thrd)->critical_count--; \
595 _thr_ast(thrd); \
598 #define THR_UMUTEX_TRYLOCK(thrd, lck) \ argument
599 _thr_umutex_trylock((lck), TID(thrd))
601 #define THR_UMUTEX_LOCK(thrd, lck) \ argument
602 _thr_umutex_lock((lck), TID(thrd))
604 #define THR_UMUTEX_TIMEDLOCK(thrd, lck, timo) \ argument
605 _thr_umutex_timedlock((lck), TID(thrd), (timo))
607 #define THR_UMUTEX_UNLOCK(thrd, lck) \ argument
608 _thr_umutex_unlock((lck), TID(thrd))
610 #define THR_LOCK_ACQUIRE(thrd, lck) \ argument
612 (thrd)->locklevel++; \
613 _thr_umutex_lock(lck, TID(thrd)); \
616 #define THR_LOCK_ACQUIRE_SPIN(thrd, lck) \ argument
618 (thrd)->locklevel++; \
619 _thr_umutex_lock_spin(lck, TID(thrd)); \
623 #define THR_ASSERT_LOCKLEVEL(thrd) \ argument
625 if (__predict_false((thrd)->locklevel <= 0)) \
629 #define THR_ASSERT_LOCKLEVEL(thrd) argument
632 #define THR_LOCK_RELEASE(thrd, lck) \ argument
634 THR_ASSERT_LOCKLEVEL(thrd); \
635 _thr_umutex_unlock((lck), TID(thrd)); \
636 (thrd)->locklevel--; \
637 _thr_ast(thrd); \
668 #define THR_LIST_ADD(thrd) do { \ argument
669 if (((thrd)->tlflags & TLFLAGS_IN_TDLIST) == 0) { \
670 TAILQ_INSERT_HEAD(&_thread_list, thrd, tle); \
671 _thr_hash_add(thrd); \
672 (thrd)->tlflags |= TLFLAGS_IN_TDLIST; \
675 #define THR_LIST_REMOVE(thrd) do { \ argument
676 if (((thrd)->tlflags & TLFLAGS_IN_TDLIST) != 0) { \
677 TAILQ_REMOVE(&_thread_list, thrd, tle); \
678 _thr_hash_remove(thrd); \
679 (thrd)->tlflags &= ~TLFLAGS_IN_TDLIST; \
682 #define THR_GCLIST_ADD(thrd) do { \ argument
683 if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) == 0) { \
684 TAILQ_INSERT_HEAD(&_thread_gc_list, thrd, gcle);\
685 (thrd)->tlflags |= TLFLAGS_IN_GCLIST; \
689 #define THR_GCLIST_REMOVE(thrd) do { \ argument
690 if (((thrd)->tlflags & TLFLAGS_IN_GCLIST) != 0) { \
691 TAILQ_REMOVE(&_thread_gc_list, thrd, gcle); \
692 (thrd)->tlflags &= ~TLFLAGS_IN_GCLIST; \
983 void _thr_stack_fix_protection(struct pthread *thrd);