git: ebf989f4010b - stable/14 - thr_new: add a flag indicating that the thread is created by C runtime
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 12 Jun 2025 18:03:08 UTC
The branch stable/14 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=ebf989f4010b537ee55e8e4680594511c73f06d8
commit ebf989f4010b537ee55e8e4680594511c73f06d8
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-05-30 11:25:17 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-06-12 18:02:51 +0000
thr_new: add a flag indicating that the thread is created by C runtime
(cherry picked from commit 89ca5cddec22f5676e9f9a91c2adfdbc574c78ca)
---
lib/libthr/thread/thr_create.c | 2 +-
sys/sys/thr.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
index 2ae7cf0cd7b2..84bbd36ed28d 100644
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -160,7 +160,7 @@ _pthread_create(pthread_t * __restrict thread,
param.tls_size = sizeof(struct tcb);
param.child_tid = &new_thread->tid;
param.parent_tid = &new_thread->tid;
- param.flags = 0;
+ param.flags = THR_C_RUNTIME;
if (new_thread->attr.flags & PTHREAD_SCOPE_SYSTEM)
param.flags |= THR_SYSTEM_SCOPE;
if (new_thread->attr.sched_inherit == PTHREAD_INHERIT_SCHED)
diff --git a/sys/sys/thr.h b/sys/sys/thr.h
index 5e83ec208f07..54766668c929 100644
--- a/sys/sys/thr.h
+++ b/sys/sys/thr.h
@@ -43,6 +43,7 @@ typedef __size_t size_t;
#define THR_SUSPENDED 0x0001
/* Create the system scope thread. */
#define THR_SYSTEM_SCOPE 0x0002
+#define THR_C_RUNTIME 0x0004
struct thr_param {
void (*start_func)(void *); /* thread entry function. */