608 |
|
|
609 |
|
// Start redraw/input thread |
610 |
|
redraw_thread_cancel = false; |
611 |
< |
redraw_thread_active = (SDL_CreateThread(redraw_func, NULL) != NULL); |
611 |
> |
redraw_thread_active = ((redraw_thread = SDL_CreateThread(redraw_func, NULL)) != NULL); |
612 |
|
if (!redraw_thread_active) { |
613 |
|
printf("FATAL: cannot create redraw thread\n"); |
614 |
|
return false; |
750 |
|
// Stop redraw thread |
751 |
|
if (redraw_thread_active) { |
752 |
|
redraw_thread_cancel = true; |
753 |
< |
// SDL_WaitThread(redraw_thread, NULL); doesn't work |
754 |
< |
while (redraw_thread_cancel); |
753 |
> |
SDL_WaitThread(redraw_thread, NULL); |
754 |
|
} |
755 |
|
redraw_thread_active = false; |
756 |
|
|
1436 |
|
|
1437 |
|
uint64 end = GetTicks_usec(); |
1438 |
|
D(bug("%lld refreshes in %lld usec = %f refreshes/sec\n", ticks, end - start, ticks * 1000000.0 / (end - start))); |
1440 |
– |
redraw_thread_cancel = false; |
1439 |
|
return 0; |
1440 |
|
} |