99 |
|
#ifdef HAVE_PTHREADS |
100 |
|
static pthread_attr_t redraw_thread_attr; // Redraw thread attributes |
101 |
|
static volatile bool redraw_thread_cancel; // Flag: Cancel Redraw thread |
102 |
+ |
static volatile bool redraw_thread_cancel_ack; // Flag: Acknowledge for redraw thread cancellation |
103 |
|
static pthread_t redraw_thread; // Redraw thread |
104 |
|
#endif |
105 |
|
|
1721 |
|
#ifdef HAVE_PTHREADS |
1722 |
|
if (redraw_thread_active) { |
1723 |
|
redraw_thread_cancel = true; |
1724 |
< |
#ifdef HAVE_PTHREAD_CANCEL |
1724 |
< |
pthread_cancel(redraw_thread); |
1725 |
< |
#endif |
1724 |
> |
redraw_thread_cancel_ack = false; |
1725 |
|
pthread_join(redraw_thread, NULL); |
1726 |
+ |
while (!redraw_thread_cancel_ack) ; |
1727 |
|
} |
1728 |
|
#endif |
1729 |
|
redraw_thread_active = false; |
2611 |
|
|
2612 |
|
uint64 end = GetTicks_usec(); |
2613 |
|
D(bug("%Ld refreshes in %Ld usec = %f refreshes/sec\n", ticks, end - start, ticks * 1000000.0 / (end - start))); |
2614 |
+ |
|
2615 |
+ |
redraw_thread_cancel_ack = true; |
2616 |
|
return NULL; |
2617 |
|
} |
2618 |
|
#endif |