Blob Blame History Raw
diff -ur xrootd-4.2.3.orig/src/XrdSys/XrdSysLinuxSemaphore.hh xrootd-4.2.3/src/XrdSys/XrdSysLinuxSemaphore.hh
--- xrootd-4.2.3.orig/src/XrdSys/XrdSysLinuxSemaphore.hh	2015-09-02 11:48:29.000000000 +0200
+++ xrootd-4.2.3/src/XrdSys/XrdSysLinuxSemaphore.hh	2015-12-23 16:08:43.652883522 +0100
@@ -155,13 +155,13 @@
             {
               int r = 0;
 
-              pthread_cleanup_push( Cleanup, pValue );
               pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, 0 );
+              pthread_cleanup_push( Cleanup, pValue );
 
               r = syscall( SYS_futex, pValue, FUTEX_WAIT, newVal, 0, 0, 0 );
 
-              pthread_setcanceltype( PTHREAD_CANCEL_DEFERRED, 0 );
               pthread_cleanup_pop( 0 );
+              pthread_setcanceltype( PTHREAD_CANCEL_DEFERRED, 0 );
 
               if( r == 0 )               // we've been woken up
                 break;