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.
+2009-04-27 Ulrich Drepper <drepper@redhat.com>
+
+ * 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.
+
2009-04-26 Ulrich Drepper <drepper@redhat.com>
* sem_open.c (sem_open): Rewrite initialization of initsem to
-/* 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 <drepper@redhat.com>, 2002.
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)
/* Prepare the next round. */
oldval = curval;
}
+#endif
}
-/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
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)
/* Prepare the next round. */
oldval = curval;
}
+#endif
}
/* Definition for thread-local data handling. nptl/i386 version.
- Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
int gscope_flag;
#ifndef __ASSUME_PRIVATE_FUTEX
int private_futex;
+#else
+ int __unused1;
#endif
+ /* Reservation of some values for the TM ABI. */
+ void *__private_tm[5];
} tcbhead_t;
# define TLS_MULTIPLE_THREADS_IN_TCB 1
__ret; })
+/* Atomic logical and. */
+#define THREAD_ATOMIC_AND(descr, member, val) \
+ (void) ({ if (sizeof ((descr)->member) == 4) \
+ asm volatile (LOCK_PREFIX "andl %1, %%gs:%P0" \
+ :: "i" (offsetof (struct pthread, member)), \
+ "ir" (val)); \
+ else \
+ /* Not necessary for other sizes in the moment. */ \
+ abort (); })
+
+
/* Atomic set bit. */
#define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
(void) ({ if (sizeof ((descr)->member) == 4) \
/* Definition for thread-local data handling. nptl/x86_64 version.
- Copyright (C) 2002-2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2002-2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
__ret; })
+/* Atomic logical and. */
+#define THREAD_ATOMIC_AND(descr, member, val) \
+ (void) ({ if (sizeof ((descr)->member) == 4) \
+ asm volatile (LOCK_PREFIX "andl %1, %%fs:%P0" \
+ :: "i" (offsetof (struct pthread, member)), \
+ "ir" (val)); \
+ else \
+ /* Not necessary for other sizes in the moment. */ \
+ abort (); })
+
+
/* Atomic set bit. */
#define THREAD_ATOMIC_BIT_SET(descr, member, bit) \
(void) ({ if (sizeof ((descr)->member) == 4) \