[vlc-devel] [PATCH 1/3] VLCEventManager: reorder initialization

Gleb Pinigin gpinigin at gmail.com
Mon Jun 10 07:12:20 CEST 2013


---
 Sources/VLCEventManager.m | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Sources/VLCEventManager.m b/Sources/VLCEventManager.m
index fdfa69a..9018ad7 100644
--- a/Sources/VLCEventManager.m
+++ b/Sources/VLCEventManager.m
@@ -188,12 +188,13 @@ static void * EventDispatcherMainLoop(void * user_data)
             NSAssert([NSThread isMultiThreaded], @"Can't put Cocoa in multithreaded mode");
         }
 
-        pthread_mutex_init(&queueLock, NULL);
-        pthread_cond_init(&signalData, NULL);
-        pthread_create(&dispatcherThread, NULL, EventDispatcherMainLoop, self);
         messageQueue = [[NSMutableArray alloc] initWithCapacity:10];
         pendingMessagesOnMainThread = [[NSMutableArray alloc] initWithCapacity:10];
         pendingMessagesLock = [[NSLock alloc] init];
+
+        pthread_mutex_init(&queueLock, NULL);
+        pthread_cond_init(&signalData, NULL);
+        pthread_create(&dispatcherThread, NULL, EventDispatcherMainLoop, self);
     }
     return self;
 }
-- 
1.7.12.4 (Apple Git-37)




More information about the vlc-devel mailing list