svn commit: r192609 - user/kmacy/releng_7_2_fcs/sys/kern
Kip Macy
kmacy at FreeBSD.org
Fri May 22 22:48:56 UTC 2009
Author: kmacy
Date: Fri May 22 22:48:55 2009
New Revision: 192609
URL: http://svn.freebsd.org/changeset/base/192609
Log:
enable condvar and friends to operate on spin locks
Modified:
user/kmacy/releng_7_2_fcs/sys/kern/kern_mutex.c
Modified: user/kmacy/releng_7_2_fcs/sys/kern/kern_mutex.c
==============================================================================
--- user/kmacy/releng_7_2_fcs/sys/kern/kern_mutex.c Fri May 22 22:22:21 2009 (r192608)
+++ user/kmacy/releng_7_2_fcs/sys/kern/kern_mutex.c Fri May 22 22:48:55 2009 (r192609)
@@ -141,7 +141,7 @@ void
lock_spin(struct lock_object *lock, int how)
{
- panic("spin locks can only use msleep_spin");
+ mtx_lock_spin((struct mtx *)lock);
}
int
@@ -158,8 +158,11 @@ unlock_mtx(struct lock_object *lock)
int
unlock_spin(struct lock_object *lock)
{
+ struct mtx *m;
- panic("spin locks can only use msleep_spin");
+ m = (struct mtx *)lock;
+ mtx_assert(m, MA_OWNED | MA_NOTRECURSED);
+ mtx_unlock_spin(m);
}
/*
More information about the svn-src-user
mailing list