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

Check-in [f924c2f8e3]

Overview
Comment:PTHREAD_NULL is not _actually_ a valid pthread_t, and should not be supplied as an argument to pthread_*() functions. On NetBSD, Tcl was faulting at [PMutexDestroy()](/home/file?ci=e29c5206a97aa935207e1b21d33ca&name=unix/tclUnixThrd.c&ln=92) in the assertion, which failed because PTHREAD_NULL is not actually a valid thread identifier, did not satisfy the intention what was trying to be asserted. pthread_t is an opaque type. On NetBSD (for example) it is a structure, with magic for sanity checks. "(pthread_t)0" does not pass this test when (e.g.) pthread_equal(t1, t2) is called. I changed tests for PTHREAD_NULL to simple equality checks (e.g. PTHREAD_NULL == pmutexPtr->thread), and guarded with the same test pthread_*() calls where appropriate (those function calls involving pmutexPtr->thread).
Timelines: family | ancestors | descendants | both | PTHREAD_NULL_handler
Files: files | file ages | folders
SHA3-256: f924c2f8e3ef65211b46a41c43e569be14359a00c404a5c56e0a65d8a0d4b60f
User & Date: bch on 2026-05-23 02:16:41.686
Other Links: branch diff | manifest | tags
References
2026-05-25
18:21 • New ticket [673f2da3a0] mind PTHREAD_NULL as sentinel value vs legitimate pthrea... artifact: eb02d01a65 user: anonymous
Context
2026-05-25
21:25
Fix [673f2d]: mind PTHREAD_NULL as sentinel value vs legitimate pthread_t arg check-in: 64563c30c6 user: jan.nijtmans tags: core-9-0-branch
2026-05-23
02:16
PTHREAD_NULL is not _actually_ a valid pthread_t, and should not be supplied as an argument to pthre... closed check-in: f924c2f8e3 user: bch tags: PTHREAD_NULL_handler
2026-05-22
15:06
finish 'apn-registry' work for gcc builds. And - as a bonus - for Cygwin too check-in: e29c5206a9 user: jan.nijtmans tags: trunk, main
Changes