ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.76 by gbeauche, 2005-01-30T21:42:14Z vs.
Revision 1.77 by gbeauche, 2005-03-21T23:57:34Z

# Line 99 | Line 99 | static bool redraw_thread_active = false
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  
# Line 1720 | Line 1721 | void X11_monitor_desc::video_close(void)
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;
# Line 2611 | Line 2611 | static void *redraw_func(void *arg)
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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines