From d5c157a978000970befcfa067410896fe08a3dcc Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 27 Apr 2009 21:55:49 +0000 Subject: * cancellation.c (__pthread_disable_asynccancel): Use THREAD_ATOMIC_AND is available. * libc-cancellation.c (__libc_disable_asynccancel): Likewise. * sysdeps/x86_64/tls.h: Define THREAD_ATOMIC_AND. * sysdeps/i386/tls.h: Likewise. (tcbhead_t): Add __private_tm member. --- nptl/cancellation.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nptl/cancellation.c') diff --git a/nptl/cancellation.c b/nptl/cancellation.c index 1d28d38..81134a6 100644 --- a/nptl/cancellation.c +++ b/nptl/cancellation.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2009 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -70,6 +70,10 @@ __pthread_disable_asynccancel (int oldtype) return; struct pthread *self = THREAD_SELF; + +#ifdef THREAD_ATOMIC_AND + THREAD_ATOMIC_AND (self, cancelhandling, ~CANCELTYPE_BITMASK); +#else int oldval = THREAD_GETMEM (self, cancelhandling); while (1) @@ -87,4 +91,5 @@ __pthread_disable_asynccancel (int oldtype) /* Prepare the next round. */ oldval = curval; } +#endif } -- cgit v1.1