simplelocks have been supported in rump for a while, allow their use.
This commit is contained in:
parent
162fa5811a
commit
698910a47a
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: ltsleep.c,v 1.12 2009/06/03 15:16:42 pooka Exp $ */
|
||||
/* $NetBSD: ltsleep.c,v 1.13 2009/06/09 15:53:05 pooka Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
|
||||
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.12 2009/06/03 15:16:42 pooka Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ltsleep.c,v 1.13 2009/06/09 15:53:05 pooka Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/proc.h>
|
||||
|
@ -57,13 +57,11 @@ ltsleep(wchan_t ident, pri_t prio, const char *wmesg, int timo,
|
|||
{
|
||||
struct ltsleeper lts;
|
||||
|
||||
if (__predict_false(slock))
|
||||
panic("simplelock not supported by rump, convert code");
|
||||
|
||||
lts.id = ident;
|
||||
cv_init(<s.cv, NULL);
|
||||
|
||||
mutex_enter(&sleepermtx);
|
||||
simple_unlock(slock);
|
||||
LIST_INSERT_HEAD(&sleepers, <s, entries);
|
||||
|
||||
/* protected by sleepermtx */
|
||||
|
@ -74,6 +72,9 @@ ltsleep(wchan_t ident, pri_t prio, const char *wmesg, int timo,
|
|||
|
||||
cv_destroy(<s.cv);
|
||||
|
||||
if (slock && (prio & PNORELOCK) == 0)
|
||||
simple_lock(slock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue