From 8c2e9a29b1fbda33e57b2d33c7bfcb0de666b1fb Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 21 Feb 2003 10:00:33 +0000 Subject: Update. * pthreadP.h: Define INVALID_TD_P and INVALID_NOT_TERMINATED_TD_P. * pthread_cancel.c: Use INVALID_TD_P. * pthread_detach.c: Likewise. * pthread_getschedparam.c: Likewise. * pthread_setschedparam.c: Likewise. * sysdeps/pthread/pthread_getcpuclockid.c: Likewise. * sysdeps/unix/sysv/linux/pthread_kill.c: Likewise. * pthread_join.c: Use INVALID_NOT_TERMINATED_TD_P. * pthread_timedjoin.c: Likewise. * tst-basic7.c: Include . --- nptl/pthreadP.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'nptl/pthreadP.h') diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index 11f7ede..e88b959 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -70,8 +70,15 @@ extern int __pthread_debug attribute_hidden; /** For now disable debugging support. */ #if 0 # define DEBUGGING_P __builtin_expect (__pthread_debug, 0) +# define INVALID_TD_P(pd) (DEBUGGING_P && __find_in_stack_list (pd) == NULL) +# define INVALID_NOT_TERMINATED_TD_P(pd) INVALID_TD_P (pd) #else # define DEBUGGING_P 0 +/* Simplified test. This will not catch all invalid descriptors but + is better than nothing. And if the test triggers the thread + descriptor is guaranteed to be invalid. */ +# define INVALID_TD_P(pd) __builtin_expect ((pd)->tid <= 0, 0) +# define INVALID_NOT_TERMINATED_TD_P(pd) __builtin_expect ((pd)->tid < 0, 0) #endif -- cgit v1.1