Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2012 19:12:09 +0000 (UTC)
From:      Robert Millan <rmh@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r233519 - in head: lib/librt sys/sys
Message-ID:  <201203261912.q2QJC9A0046591@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rmh
Date: Mon Mar 26 19:12:09 2012
New Revision: 233519
URL: http://svn.freebsd.org/changeset/base/233519

Log:
  Register signal 33 explicitly as reserved by real-time library, and
  use it by its new name (SIGLIBRT) rather than internal definition
  in librt (SIGSERVICE).
  
  Approved by:	davidxu, arch

Modified:
  head/lib/librt/sigev_thread.c
  head/lib/librt/sigev_thread.h
  head/sys/sys/signal.h

Modified: head/lib/librt/sigev_thread.c
==============================================================================
--- head/lib/librt/sigev_thread.c	Mon Mar 26 19:06:59 2012	(r233518)
+++ head/lib/librt/sigev_thread.c	Mon Mar 26 19:12:09 2012	(r233519)
@@ -224,11 +224,11 @@ __sigev_get_sigevent(struct sigev_node *
 	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 @@ __sigev_delete_node(struct sigev_node *s
 	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 @@ sigev_thread_create(int usedefault)
 	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_service_loop(void *arg)
 	__sigev_list_unlock();
 
 	sigemptyset(&set);
-	sigaddset(&set, SIGSERVICE);
+	sigaddset(&set, SIGLIBRT);
 	for (;;) {
 		ret = sigwaitinfo(&set, &si);
 

Modified: head/lib/librt/sigev_thread.h
==============================================================================
--- head/lib/librt/sigev_thread.h	Mon Mar 26 19:06:59 2012	(r233518)
+++ head/lib/librt/sigev_thread.h	Mon Mar 26 19:12:09 2012	(r233519)
@@ -67,8 +67,6 @@ struct sigev_thread {
 #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);

Modified: head/sys/sys/signal.h
==============================================================================
--- head/sys/sys/signal.h	Mon Mar 26 19:06:59 2012	(r233518)
+++ head/sys/sys/signal.h	Mon Mar 26 19:12:09 2012	(r233519)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203261912.q2QJC9A0046591>