Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6abbe2a6d1edfefc9c2923902b5eab7a70d756de
Ticket: 406058ffffffffffffffffffffffffffffffffff
Bug in thread library
User & Date: villalba on 2001-05-10 20:50:11
Changes

  1. closedate changed to: "2001-05-10T13:50:11"
  2. closer changed to: "villalba"
  3. icomment:
    Logged In: YES 
    user_id=166340
    
    It isn“t a problem of the thread library, but Tcl core. Pay 
    attention to the following easy example.
    
    #include <tcl.h>
    
    int ThreadMainProc( int& I ) 
    {
    I = 0;
    return 0;
    }
    
    int main( void )
    {
    int I = 1;
    Tcl_ThreadId* ThreadId = NULL;
    
    // At this point the number of handles is 14 and of 
    threads 1.
    
    if( Tcl_CreateThread(
    ThreadId, 
    (unsigned int (__stdcall *)(void 
    *)) ThreadMainProc,
    &I,
    TCL_THREAD_STACK_DEFAULT,
    TCL_THREAD_NOFLAGS ) != TCL_OK)
    {
    return 1;// Error handle
    }
    
    // This loop is finished by the thread.
    // At this point the number of handles is 15 and of 
    threads 2.
    while( I )
    printf( "%d", I );
    
    // At this point the number of handles is 15 and of 
    threads 1, i.e. the thread is dead.
    
    return 0;
    }
    
    
    
    
  4. login: "villalba"
  5. mimetype: "text/plain"
  6. username: "villalba"