Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c04206b13771d787ff01bba7e6dd26efe9ca33a4
Ticket: 442646ffffffffffffffffffffffffffffffffff
Close Windows handle from _beginthreadex
User & Date: mdejong on 2001-07-19 02:14:06
Changes

  1. assignee changed to: "andreas_kupries"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The documentation for the _beginthreadex method
    indicates that the caller is responsible for
    closing the returned HANDLE object. Tcl does
    not close this handle which seems like a memory
    leak to me. The following patch should fix the
    problem, but if someone that knows a bit more
    about Windows threads could take a peek I would
    feel much better about it. The part I am unsure
    of is if it is ok to call CloseHandle() on
    a thread handle that is currently alive.
    
    
    Here are some related URLs:
    
    http://support.microsoft.com/support/kb/articles/q132/0/78.asp
    http://technology.niagarac.on.ca/courses/comp831/win32/_beginthread.htm
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__beginthread.2c_._beginthreadex.asp
    http://www.microsoft.com/msj/0799/win32/win320799.htm
    
    
    2001-07-18  Mo DeJong  <[email protected]>
    
    * win/tclWinThrd.c (Tcl_CreateThread): Close Windows
    HANDLE
    returned by _beginthreadex since the MS documentation
    states
    that this handle is not closed by a later call to
    _endthreadex.
    
    
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "mdejong"
  9. subsystem changed to: "49. Threading"
  10. title changed to: "Close Windows handle from _beginthreadex"
  11. type changed to: "Patch"