diff options
author | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2015-01-24 23:20:28 +0100 |
---|---|---|
committer | Wolfgang Draxinger <Wolfgang.Draxinger@draxit.de> | 2015-01-24 23:20:28 +0100 |
commit | 6521285ecab5529adbf716f21bc867a64a224779 (patch) | |
tree | 5affb3f09cc5014a73d74c3d6ff4a9e2c32f64c4 /wglarb.c | |
parent | b8a7bb6d6b75ab708a9b0834183c91cc1c054b6c (diff) | |
download | wglarb-6521285ecab5529adbf716f21bc867a64a224779.tar.gz wglarb-6521285ecab5529adbf716f21bc867a64a224779.tar.bz2 |
rewrote mutex creation to not use goto
Diffstat (limited to 'wglarb.c')
-rw-r--r-- | wglarb.c | 22 |
1 files changed, 9 insertions, 13 deletions
@@ -48,21 +48,17 @@ static DWORD wglarb_intermediary_lock(void) /* //// FINISH \\\\ */ - if( dst_mutex ) { - /* In this case we lost the race and another thread - * beat this thread in creating a mutex object. - * Clean up and wait for the proper mutex. */ - ReleaseMutex(new_mutex); - CloseHandle(new_mutex); - goto wait_for_mutex; + if( !dst_mutex ) { + /* mutex created in one time initialization and held + * by calling thread. Return signaled status. */ + return WAIT_OBJECT_0; } - - /* mutex created in one time initialization and hold - * by calling thread. Return signaled status. */ - return WAIT_OBJECT_0; + /* In this case we lost the race and another thread + * beat this thread in creating a mutex object. + * Clean up and wait for the proper mutex. */ + ReleaseMutex(new_mutex); + CloseHandle(new_mutex); } - -wait_for_mutex: return WaitForSingleObject(wglarb_intermediary_mutex, INFINITE); } |