# include <time.h>
#else
# if defined ( sgi ) && !defined( __GNUC__ )
- // This works arounf a bug triggered when using MipsPro 7.4.1
+ // This works around a bug triggered when using MipsPro 7.4.1
// and (at least) IRIX 6.5.20
# include <iostream>
# endif
/**
* 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
}
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;
}