2 * Copyright 2009 Colin Günther, coling@gmx.de
3 * All rights reserved. Distributed under the terms of the MIT License.
7 #include <compat/sys/systm.h>
8 #include <compat/sys/kernel.h>
9 #include <compat/sys/mutex.h>
10 #include <compat/sys/condvar.h>
16 msleep(void* identifier
, struct mtx
* mutex
, int priority
,
17 const char* description
, int timeout
)
22 conditionPublish(&sleep
, identifier
, description
);
25 status
= publishedConditionTimedWait(identifier
, timeout
);
28 conditionUnpublish(&sleep
);
35 wakeup(void* identifier
)
37 publishedConditionNotifyAll(identifier
);
42 _pause(const char* waitMessage
, int timeout
)
45 KASSERT(timeout
!= 0, ("pause: timeout required"));
46 return tsleep(&waitChannel
, 0, waitMessage
, timeout
);