2026-05-23 02:16:41
— part of check-in
[f924c2f8e3]
on branch PTHREAD_NULL_handler
— 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).
(user:
bch,
size: 21004)
[annotate]
[blame][check-ins using]