Skip to content
Tcl Source Code Check-in [231c699c87]
Login

Check-in [231c699c87]

Overview
Comment:On Windows, join threads using Win32 HANDLEs. This works by extending the existing WinThread structure with the thread's HANDLE. The lifetime of the WinThread structure is until the thread terminates, for non-joinable threads, or until the thread is joined. For joinable threadsd, the thread's HANDLE remains open; Windows signals the HANDLE when the thread terminates. The thread's return value is transported using the standard Windows mechanism. A new thread-specific variable is introduced so a thread can find its WinThread structure. Initial threads (those not created via Tcl_CreateThread) receive a WinThread lazily, when Tcl_GetCurrentThread is called for the first time. Instead of using the Windows ThreadId as the Tcl threadId, the address of the WinThread is used. The least significant bit of the pointer value is used to distinguish joinable threads from non-joinable threads. (For future use or debugging, the Windows ThreadId is stored in the WinThread structure as well.) generic/tclThreadJoin.c is made redudant by this patch.
Timelines: family | ancestors | descendants | both | windows-thread-join
Files: files | file ages | folders
SHA3-256: 231c699c87686173cbf513a106c358409ecca1f56d5a81bb5e12d1e755038a4a
User & Date: mchn1350 on 2023-03-28 18:58:30.431
Other Links: branch diff | manifest | tags
Context
2023-03-29
09:02
added copyright note check-in: 7597fe65cc user: konrad.schwarz tags: windows-thread-join
2023-03-28
18:58
On Windows, join threads using Win32 HANDLEs. This works by extending the existing WinThread struct... check-in: 231c699c87 user: mchn1350 tags: windows-thread-join
2023-03-23
07:28
Merge-mark check-in: 8c96c87de4 user: konrad.schwarz tags: trunk, main
Changes