|
2023-03-29
| ||
| 08:59 | • Ticket [9b63fd201b] Fix Thread Join on WIndows status still Open with 3 othe... artifact: f53bf0f33b user: konrad.schwarz | |
|
2023-03-28
| ||
| 19:09 | • Ticket [9b63fd201b]: 4 changes artifact: e3d087bdf8 user: konrad.schwarz | |
| 19:08 | • Add attachment thread_join_win32.patch to ticket [9b63fd201b87c737|9b63... artifact: 6b5a40ba1f user: konrad.schwarz | |
|
2023-02-21
| ||
| 07:35 | • Ticket [9b63fd201b] Fix Thread Join on WIndows status still Open with 3 othe... artifact: 939dd41325 user: jan.nijtmans | |
|
2023-02-20
| ||
| 21:20 | • New ticket [9b63fd201b]. artifact: b06b9af25d user: konrad.schwarz | |
Fix Thread Join on WIndows
Open9b63fd201b87c737ef375cd95b5ebbc79629c9abCreated 4 years agoUpdated 4 years ago
Descriptionplain2023-02-20 21:20:43
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.
jan.nijtmanswiki2023-02-21 07:35:48
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!
konrad.schwarz (claiming to be Konrad Schwarz)plain2023-03-28 19:09:48
Patch has been added.
konrad.schwarzplain2023-03-29 08:59:56
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?
Log in (anonymous is fine) to add a comment.