[PATCH] add SIGLIBRT to sys/signal.h

Robert Millan rmh at freebsd.org
Sun Mar 25 19:08:45 UTC 2012


El 25 de març de 2012 3:51, David Xu <listlog2011 at gmail.com> ha escrit:
> Yes, but I think the signal name is too general, should it be SIGLIBRT or
> something else ?

Ok.  Renaming makes the patch a bit larger, see attachment.

Looks good?

-- 
Robert Millan
-------------- next part --------------
Index: lib/librt/sigev_thread.c
===================================================================
--- lib/librt/sigev_thread.c	(revision 233435)
+++ lib/librt/sigev_thread.c	(working copy)
@@ -224,11 +224,11 @@
 	sigev_id_t id)
 {
 	/*
-	 * Build a new sigevent, and tell kernel to deliver SIGSERVICE
+	 * Build a new sigevent, and tell kernel to deliver SIGLIBRT
 	 * signal to the new thread.
 	 */
 	newevp->sigev_notify = SIGEV_THREAD_ID;
-	newevp->sigev_signo  = SIGSERVICE;
+	newevp->sigev_signo  = SIGLIBRT;
 	newevp->sigev_notify_thread_id = (lwpid_t)sn->sn_tn->tn_lwpid;
 	newevp->sigev_value.sival_ptr = (void *)id;
 }
@@ -279,7 +279,7 @@
 	LIST_REMOVE(sn, sn_link);
 
 	if (--sn->sn_tn->tn_refcount == 0)
-		_pthread_kill(sn->sn_tn->tn_thread, SIGSERVICE);
+		_pthread_kill(sn->sn_tn->tn_thread, SIGLIBRT);
 	if (sn->sn_flags & SNF_WORKING)
 		sn->sn_flags |= SNF_REMOVED;
 	else
@@ -326,7 +326,7 @@
 	LIST_INSERT_HEAD(&sigev_threads, tn, tn_link);
 	__sigev_list_unlock();
 
-	sigfillset(&set);	/* SIGSERVICE is masked. */
+	sigfillset(&set);	/* SIGLIBRT is masked. */
 	sigdelset(&set, SIGBUS);
 	sigdelset(&set, SIGILL);
 	sigdelset(&set, SIGFPE);
@@ -378,7 +378,7 @@
 	__sigev_list_unlock();
 
 	sigemptyset(&set);
-	sigaddset(&set, SIGSERVICE);
+	sigaddset(&set, SIGLIBRT);
 	for (;;) {
 		ret = sigwaitinfo(&set, &si);
 
Index: lib/librt/sigev_thread.h
===================================================================
--- lib/librt/sigev_thread.h	(revision 233435)
+++ lib/librt/sigev_thread.h	(working copy)
@@ -67,8 +67,6 @@
 #define	SNF_REMOVED		0x02
 #define	SNF_SYNC		0x04
 
-#define	SIGSERVICE		(SIGTHR+1)
-
 int	__sigev_check_init();
 struct sigev_node *__sigev_alloc(int, const struct sigevent *,
 	struct sigev_node *, int);
Index: sys/sys/signal.h
===================================================================
--- sys/sys/signal.h	(revision 233435)
+++ sys/sys/signal.h	(working copy)
@@ -111,6 +111,7 @@
 #if __BSD_VISIBLE
 #define	SIGTHR		32	/* reserved by thread library. */
 #define	SIGLWP		SIGTHR
+#define SIGLIBRT	33	/* reserved by real-time library. */
 #endif
 
 #define	SIGRTMIN	65


More information about the freebsd-arch mailing list