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

Comparing SheepShaver/src/Unix/video_x.cpp (file contents):
Revision 1.27 by gbeauche, 2004-06-11T22:09:27Z vs.
Revision 1.28 by gbeauche, 2004-06-22T19:32:00Z

# Line 65 | Line 65 | static int16 mouse_wheel_mode;
65   static int16 mouse_wheel_lines;
66   static bool redraw_thread_active = false;       // Flag: Redraw thread installed
67   static pthread_attr_t redraw_thread_attr;       // Redraw thread attributes
68 + static volatile bool redraw_thread_cancel;      // Flag: Cancel Redraw thread
69   static pthread_t redraw_thread;                         // Redraw thread
70  
71   static bool local_X11;                                          // Flag: X server running on local machine?
# Line 1193 | Line 1194 | bool VideoInit(void)
1194          // Start periodic thread
1195          XSync(x_display, false);
1196          Set_pthread_attr(&redraw_thread_attr, 0);
1197 +        redraw_thread_cancel = false;
1198          redraw_thread_active = (pthread_create(&redraw_thread, &redraw_thread_attr, redraw_func, NULL) == 0);
1199          D(bug("Redraw thread installed (%ld)\n", redraw_thread));
1200          return true;
# Line 1207 | Line 1209 | void VideoExit(void)
1209   {
1210          // Stop redraw thread
1211          if (redraw_thread_active) {
1212 +                redraw_thread_cancel = true;
1213                  pthread_cancel(redraw_thread);
1214                  pthread_join(redraw_thread, NULL);
1215                  redraw_thread_active = false;
# Line 2295 | Line 2298 | static void *redraw_func(void *arg)
2298          int64 ticks = 0;
2299          uint64 next = GetTicks_usec() + VIDEO_REFRESH_DELAY;
2300  
2301 <        for (;;) {
2301 >        while (!redraw_thread_cancel) {
2302  
2303                  // Pause if requested (during video mode switches)
2304                  while (thread_stop_req)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines