]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 12 Dec 2002 02:28:37 +0000 (02:28 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 12 Dec 2002 02:28:37 +0000 (02:28 +0000)
* sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
Remember function and argument even if cancellation handler
function is not available.
(__libc_cleanup_region_end): Execute registered function directly if
pthread functions are not available.
(__libc_cleanup_end): Likewise.

nptl/ChangeLog
nptl/sysdeps/pthread/bits/libc-lock.h

index cc8ac2af4eb4354297276afa8d666f615fc354a2..a6796211a09d83787dad44e8b77e4c555e45360f 100644 (file)
@@ -1,5 +1,12 @@
 2002-12-11  Ulrich Drepper  <drepper@redhat.com>
 
+       * sysdeps/pthread/bits/libc-lock.h (__libc_cleanup_region_start):
+       Remember function and argument even if cancellation handler
+       function is not available.
+       (__libc_cleanup_region_end): Execute registered function directly if
+       pthread functions are not available.
+       (__libc_cleanup_end): Likewise.
+
        * init.c (__pthread_initialize_minimal): Fix initialization in
        static lib by preventing gcc from being too clever.
 
index cb2154956b900426eda91c21b1396b89b7fdee38..de2ec7bb2508fbd9cb3eaa2a474241c547a1d4a1 100644 (file)
@@ -336,23 +336,28 @@ typedef pthread_key_t __libc_key_t;
 /* Start critical region with cleanup.  */
 #define __libc_cleanup_region_start(DOIT, FCT, ARG) \
   { struct _pthread_cleanup_buffer _buffer;                                  \
-    int _avail = (DOIT) && _pthread_cleanup_push_defer != NULL;                      \
+    int _avail = _pthread_cleanup_push_defer != NULL;                        \
     if (_avail) {                                                            \
       _pthread_cleanup_push_defer (&_buffer, (FCT), (ARG));                  \
+    } else if (DOIT) {                                                       \
+      _buffer.__routine = (FCT);                                             \
+      _buffer.__arg = (ARG);                                                 \
     }
 
 /* End critical region with cleanup.  */
 #define __libc_cleanup_region_end(DOIT) \
     if (_avail) {                                                            \
       _pthread_cleanup_pop_restore (&_buffer, (DOIT));                       \
-    }                                                                        \
+    } else if (DOIT)                                                         \
+      _buffer.__routine (_buffer.__arg);                                     \
   }
 
 /* Sometimes we have to exit the block in the middle.  */
 #define __libc_cleanup_end(DOIT) \
     if (_avail) {                                                            \
       _pthread_cleanup_pop_restore (&_buffer, (DOIT));                       \
-    }
+    } else if (DOIT)                                                         \
+      _buffer.__routine (_buffer.__arg)
 
 /* Create thread-specific key.  */
 #define __libc_key_create(KEY, DESTRUCTOR) \
This page took 0.04778 seconds and 5 git commands to generate.