Sack Library Documentation
ContentsIndexReferenceHome
Example
PTHREAD main_thread;
   
PTRSZVAL CPROC WakeMeThread( PTHREAD thread )
{
   // get the value passed to ThreadTo as user_data.
   PTRSZVAL user_data = GetThreadParam( thread );
   // let the main thread sleep a little wile
    WakeableSleep( 250 );
   // then wake it up
    WakeThread( main_thread );
    return 0;
}
   
int main( void )
{
    // save my PTHREAD globally.
    main_thread = MakeThread();
    // create a thread that can wake us
    ThreadTo( WakeMeThread, 0 );
    // demonstrate sleeping
    WakableSleep( SLEEP_FOREVER );
    return 0;
}
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.
Copyright (c) 2000+. All rights reserved.