Browse Source

VLCEventManager: reorder initialization

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Gleb Pinigin 12 years ago
parent
commit
398620dd50
1 changed files with 4 additions and 3 deletions
  1. 4 3
      Sources/VLCEventManager.m

+ 4 - 3
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;
 }