svn commit: r244253 - in projects/calloutng/sys: kern sys

Alexander Motin mav at FreeBSD.org
Sat Dec 15 11:44:05 UTC 2012


Author: mav
Date: Sat Dec 15 11:44:04 2012
New Revision: 244253
URL: http://svnweb.freebsd.org/changeset/base/244253

Log:
  Add msleep_spin_flags() KPI.

Modified:
  projects/calloutng/sys/kern/kern_synch.c
  projects/calloutng/sys/sys/systm.h

Modified: projects/calloutng/sys/kern/kern_synch.c
==============================================================================
--- projects/calloutng/sys/kern/kern_synch.c	Sat Dec 15 10:56:16 2012	(r244252)
+++ projects/calloutng/sys/kern/kern_synch.c	Sat Dec 15 11:44:04 2012	(r244253)
@@ -266,7 +266,8 @@ _sleep(void *ident, struct lock_object *
 }
 
 int
-msleep_spin(void *ident, struct mtx *mtx, const char *wmesg, int timo)
+msleep_spin_flags(void *ident, struct mtx *mtx, const char *wmesg, int timo,
+    int flags)
 {
 	struct thread *td;
 	struct proc *p;
@@ -305,7 +306,7 @@ msleep_spin(void *ident, struct mtx *mtx
 	 */
 	sleepq_add(ident, &mtx->lock_object, wmesg, SLEEPQ_SLEEP, 0);
 	if (timo)
-		sleepq_set_timeout(ident, timo);
+		sleepq_set_timeout_flags(ident, timo, flags);
 
 	/*
 	 * Can't call ktrace with any spin locks held so it can lock the

Modified: projects/calloutng/sys/sys/systm.h
==============================================================================
--- projects/calloutng/sys/sys/systm.h	Sat Dec 15 10:56:16 2012	(r244252)
+++ projects/calloutng/sys/sys/systm.h	Sat Dec 15 11:44:04 2012	(r244253)
@@ -356,8 +356,10 @@ int	_sleep(void *chan, struct lock_objec
 #define	msleep_bt(chan, mtx, pri, wmesg, bt, pr)			\
 	_sleep((chan), &(mtx)->lock_object, (pri), (wmesg) 0, (bt),	\
 	    (pr), 0)
-int	msleep_spin(void *chan, struct mtx *mtx, const char *wmesg, int timo)
-	    __nonnull(1);
+int	msleep_spin_flags(void *chan, struct mtx *mtx, const char *wmesg,
+	    int timo, int flags) __nonnull(1);
+#define	msleep_spin(chan, mtx, wmesg, timo)				\
+	msleep_spin_flags((chan), (mtx), (wmesg), (timo), 0)
 int	pause(const char *wmesg, int timo);
 #define	tsleep(chan, pri, wmesg, timo)					\
 	_sleep((chan), NULL, (pri), (wmesg), (timo), NULL, NULL, 0)


More information about the svn-src-projects mailing list