From 5cffacb59ef3eca4cef0a20b7e9ab626883ef722 Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: Wed, 23 Dec 2015 17:11:44 +0100 Subject: [PATCH] Order pthread cleanup statements --- src/XrdSys/XrdSysLinuxSemaphore.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/XrdSys/XrdSysLinuxSemaphore.hh b/src/XrdSys/XrdSysLinuxSemaphore.hh index f0f299b06cb..56a73793b3d 100644 --- a/src/XrdSys/XrdSysLinuxSemaphore.hh +++ b/src/XrdSys/XrdSysLinuxSemaphore.hh @@ -155,13 +155,13 @@ namespace XrdSys { 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;