src/events/SDL_events.c
changeset 1028 5ba65305c954
parent 769 b8d311d90021
child 1123 28ac87a38c17
--- a/src/events/SDL_events.c	Wed Jan 12 19:38:24 2005 +0000
+++ b/src/events/SDL_events.c	Thu Jan 13 23:24:56 2005 +0000
@@ -91,7 +91,6 @@
 
 static int SDL_GobbleEvents(void *unused)
 {
-	SDL_SetTimerThreaded(2);
 	event_thread = SDL_ThreadID();
 	while ( SDL_EventQ.active ) {
 		SDL_VideoDevice *video = current_video;
@@ -114,7 +113,7 @@
 
 		/* Give up the CPU for the rest of our timeslice */
 		SDL_EventLock.safe = 1;
-		if( SDL_timer_running ) {
+		if ( SDL_timer_running ) {
 			SDL_ThreadedTimerCheck();
 		}
 		SDL_Delay(1);
@@ -162,6 +161,8 @@
 		}
 		SDL_EventLock.safe = 0;
 
+		/* The event thread will handle timers too */
+		SDL_SetTimerThreaded(2);
 		SDL_EventThread = SDL_CreateThread(SDL_GobbleEvents, NULL);
 		if ( SDL_EventThread == NULL ) {
 			return(-1);