Norman Vine wrote:

But the question remains how best to get the threaded tile manager
working and 'behaving' under Win32 and OS X.
Does this patch work by any chance?

Erik

--- /home/erik/src/CVS/fgfs/SimGear/simgear/threads/SGThread.cxx        Sat Sep  7 
04:58:20 2002
+++ SimGear/simgear/threads/SGThread.cxx        Wed Dec  4 21:29:37 2002
@@ -19,18 +19,20 @@
 void
 SGThread::set_cancel( cancel_t mode )
 {
+    int oldstate;
+
     switch (mode)
     {
     case CANCEL_DISABLE:
-       pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, 0 );
+       pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &oldstate );
        break;
     case CANCEL_DEFERRED:
-       pthread_setcanceltype( PTHREAD_CANCEL_DEFERRED, 0 );
-       pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0 );
+       pthread_setcanceltype( PTHREAD_CANCEL_DEFERRED, &oldstate );
+       pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &oldstate );
        break;
     case CANCEL_IMMEDIATE:
-       pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, 0 );
-       pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, 0 );
+       pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, &oldstate );
+       pthread_setcancelstate( PTHREAD_CANCEL_ENABLE, &oldstate );
        break;
     default:
        break;

Reply via email to