Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2012 11:44:05 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r244253 - in projects/calloutng/sys: kern sys
Message-ID:  <201212151144.qBFBi5Tn053759@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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