]> git.mxchange.org Git - simgear.git/blobdiff - simgear/threads/SGThread.hxx
MSVC fix.
[simgear.git] / simgear / threads / SGThread.hxx
index fd7d4e660fbaac5c50cd419a590e9700e2b066bc..fcbc0cb59bc61640f5f59113f9df5ce933ea1ff6 100644 (file)
@@ -67,9 +67,11 @@ public:
 
     /**
      * Start the underlying thread of execution.
+     * @param cpu An optional parameter to specify on which CPU to run this
+     * thread (only supported on IRIX at this time).
      * @return Pthread error code if execution fails, otherwise returns 0.
      */
-    int start();
+    int start( unsigned cpu = 0 );
 
     /**
      * Sends a cancellation request to the underlying thread.  The target
@@ -130,10 +132,14 @@ SGThread::~SGThread()
 }
 
 inline int
-SGThread::start()
+SGThread::start( unsigned cpu )
 {
     int status = pthread_create( &tid, 0, start_handler, this );
     assert( status == 0 );
+#if defined( sgi )
+    if ( !status && !cpu )
+        pthread_setrunon_np( cpu );
+#endif
     return status;
 }