Artifacts Associated With Ticket 9b63fd201b
Ticket change [b06b9af25d] (rid 208937) by konrad.schwarz on 2023-02-20 21:20:43:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
The manual page for Thread states "Windows currently does not support joinable threads. This flag value is therefore ignored on this platform." A cursory look at the implementation shows that thread joining is implemented, but in a round-about way, using the ThreadJoin module that manages a list of joinable threads. The proper way to join a thread (i.e., synchronously wait for a thread's termination) in Win32 is to Wait (e.g., WaitForSingleObject()) on the thread handle, returned e.g. by the _beginthreadex() function. The thread's exit status can be retrieved with the Win32 GetExitCodeThread() function. While the thread is still running, this function will return a fixed value (259), but once the thread has exited (when the thread's handle has been signaled), the unadulterated (32-bit) exit code is returned by GetExitCodeThread(). (The MSDN documentation is poorly written, so missing this is quite understandable.) The current implementation closes this handle immediately, which is a mistake. If you like, I could probably provide a patch.
- foundin initialized to: "All"
- is_private initialized to: "0"
- login: "konrad.schwarz"
- priority initialized to: "5 Medium"
- private_contact initialized to: "80ea11e9d893f90ae1b5d3c2e6c94600b62863e9"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "konrad.schwarz"
- subsystem initialized to: "80. Thread Package"
- title initialized to: "Fix Thread Join on WIndows"
- type initialized to: "Bug"
Ticket change [939dd41325] (rid 208948) by jan.nijtmans on 2023-02-21 07:35:48:
- icomment:
Is this ticket meant for the Thread package or for Tcl itself? See: [https://core.tcl-lang.org/thread]. Whatever it's meant for, yes, a patch would help a lot!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Add attachment "thread_join_win32.patch" [6b5a40ba1f] (rid 211148) by konrad.schwarz on 2023-03-28 19:08:41.
Ticket change [e3d087bdf8] (rid 211149) by konrad.schwarz on 2023-03-28 19:09:48:
- icomment: "Patch has been added."
- login: "konrad.schwarz"
- mimetype: "text/plain"
- username: "Konrad Schwarz"
Ticket change [f53bf0f33b] (rid 211163) by konrad.schwarz on 2023-03-29 08:59:56:
- icomment:
Sorry, I misunderstood the fossil patch mechanism. I was expected it to include commits, but in fact it includes only un-committed changes. How do I communicate my changes back to you? Can I push to the main Tcl repo?
- login: "konrad.schwarz"
- mimetype: "text/plain"
- icomment: