Make sure TIB_INIT correctly initializes tib_thread_flags; regression
authormiod <miod@openbsd.org>
Fri, 8 Dec 2023 19:14:36 +0000 (19:14 +0000)
committermiod <miod@openbsd.org>
Fri, 8 Dec 2023 19:14:36 +0000 (19:14 +0000)
introduced in 1.3, causing sporadic pthread_main_np() erroneous results
(and possibly more subtle problems).

With and ok kurt@

include/tib.h

index 97dc08c..313745f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: tib.h,v 1.9 2022/12/27 07:44:56 jmc Exp $     */
+/*     $OpenBSD: tib.h,v 1.10 2023/12/08 19:14:36 miod Exp $   */
 /*
  * Copyright (c) 2011,2014 Philip Guenther <guenther@openbsd.org>
  *
@@ -216,6 +216,7 @@ struct tib {
                (tib)->tib_canceled     = 0;            \
                (tib)->tib_dtv          = (dtv);        \
                (tib)->tib_errno        = 0;            \
+               (tib)->tib_thread_flags = 0;            \
                _TIB_PREP(tib);                         \
        } while (0)