1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
* 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 <signal.h>.
This commit is contained in:
Ulrich Drepper
2003-02-21 10:00:33 +00:00
parent 8b1a8bb409
commit 8c2e9a29b1
10 changed files with 85 additions and 36 deletions

View File

@ -17,6 +17,7 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <signal.h>
#include "pthreadP.h"
#include "atomic.h"
@ -27,8 +28,13 @@ pthread_cancel (th)
pthread_t th;
{
volatile struct pthread *pd = (volatile struct pthread *) th;
int result = 0;
/* Make sure the descriptor is valid. */
if (INVALID_TD_P (pd))
/* Not a valid thread handle. */
return ESRCH;
int result = 0;
while (1)
{
int oldval = pd->cancelhandling;