Allen Webster 2016-03-24 10:02:08 -04:00
commit fb57a515c9
1 changed files with 6 additions and 0 deletions

View File

@ -1935,6 +1935,8 @@ main(int argc, char **argv)
exchange_vars.thread.queues[BACKGROUND_THREADS].semaphore = exchange_vars.thread.queues[BACKGROUND_THREADS].semaphore =
LinuxSemToHandle(&linuxvars.thread_semaphores[BACKGROUND_THREADS]); LinuxSemToHandle(&linuxvars.thread_semaphores[BACKGROUND_THREADS]);
system_acquire_lock(FRAME_LOCK);
for(i32 i = 0; i < linuxvars.groups[BACKGROUND_THREADS].count; ++i){ for(i32 i = 0; i < linuxvars.groups[BACKGROUND_THREADS].count; ++i){
Thread_Context *thread = linuxvars.groups[BACKGROUND_THREADS].threads + i; Thread_Context *thread = linuxvars.groups[BACKGROUND_THREADS].threads + i;
thread->id = i + 1; thread->id = i + 1;
@ -2514,11 +2516,15 @@ main(int argc, char **argv)
LinuxRedrawTarget(); LinuxRedrawTarget();
} }
system_release_lock(FRAME_LOCK);
u64 time_diff = system_time() - start_time; u64 time_diff = system_time() - start_time;
if(time_diff < frame_useconds){ if(time_diff < frame_useconds){
usleep(frame_useconds - time_diff); usleep(frame_useconds - time_diff);
} }
system_acquire_lock(FRAME_LOCK);
if(result.mouse_cursor_type != linuxvars.cursor){ if(result.mouse_cursor_type != linuxvars.cursor){
Cursor c = xcursors[result.mouse_cursor_type]; Cursor c = xcursors[result.mouse_cursor_type];
XDefineCursor(linuxvars.XDisplay, linuxvars.XWindow, c); XDefineCursor(linuxvars.XDisplay, linuxvars.XWindow, c);