Sack Library Documentation
ContentsIndexReferenceHome
Example
PTHREAD main_thread;
LOGICAL thread_finished_check;
   
PTRSZVAL CPROC ThreadProc( PTHREAD thread )
{
    if( IsThisThread( main_thread ) )
         printf( "This thread is not the main thread.\n" );
    else
         printf( "This is the main thread - cannot happen :)\n" );
   
    // mark that this thread is complete
    thread_finished_check = TRUE;
   
    // hmm - for some reason, just pass the PTRSZVAL that was passed to ThreadTo as the result.
    return GetThreadParam( thread );
}
   
int main( void )
{
     main_thread = MakeThread();
     ThreadTo( ThreadProc, 0 );
   
     // wait for the thread to finish its thread identity check.
     while( !thread_finished_check )
         Relinquish();
   
     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.