git: 31760ee65ae3 - main - libthr: add stable user interface for sigfastblock(2)
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 19 May 2025 06:08:00 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=31760ee65ae3e79434fb257d93e17a6de6021f48
commit 31760ee65ae3e79434fb257d93e17a6de6021f48
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-05-16 13:18:21 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-05-19 06:07:43 +0000
libthr: add stable user interface for sigfastblock(2)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D50377
---
include/pthread_np.h | 2 ++
lib/libthr/pthread.map | 2 ++
lib/libthr/thread/thr_sig.c | 19 +++++++++++++++++++
3 files changed, 23 insertions(+)
diff --git a/include/pthread_np.h b/include/pthread_np.h
index dcc762156a67..a9e738540db4 100644
--- a/include/pthread_np.h
+++ b/include/pthread_np.h
@@ -59,6 +59,8 @@ int pthread_resume_np(pthread_t);
int pthread_peekjoin_np(pthread_t, void **);
void pthread_set_name_np(pthread_t, const char *);
int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
+void pthread_signals_block_np(void);
+void pthread_signals_unblock_np(void);
int pthread_single_np(void);
void pthread_suspend_all_np(void);
int pthread_suspend_np(pthread_t);
diff --git a/lib/libthr/pthread.map b/lib/libthr/pthread.map
index f75ef4c9135e..1c8dde03367b 100644
--- a/lib/libthr/pthread.map
+++ b/lib/libthr/pthread.map
@@ -339,5 +339,7 @@ FBSD_1.6 {
};
FBSD_1.8 {
+ pthread_signals_block_np;
+ pthread_signals_unblock_np;
pthread_sigqueue;
};
diff --git a/lib/libthr/thread/thr_sig.c b/lib/libthr/thread/thr_sig.c
index c5ee5aa8423b..2cd3de512d1c 100644
--- a/lib/libthr/thread/thr_sig.c
+++ b/lib/libthr/thread/thr_sig.c
@@ -37,6 +37,7 @@
#include <stdlib.h>
#include <string.h>
#include <pthread.h>
+#include <pthread_np.h>
#include "un-namespace.h"
#include "libc_private.h"
@@ -163,6 +164,24 @@ _thr_signal_block_setup(struct pthread *curthread)
__sys_sigfastblock(SIGFASTBLOCK_SETPTR, &curthread->fsigblock);
}
+void
+pthread_signals_block_np(void)
+{
+ struct pthread *curthread;
+
+ curthread = _get_curthread();
+ _thr_signal_block(curthread);
+}
+
+void
+pthread_signals_unblock_np(void)
+{
+ struct pthread *curthread;
+
+ curthread = _get_curthread();
+ _thr_signal_unblock(curthread);
+}
+
int
_thr_send_sig(struct pthread *thread, int sig)
{