freebsd11_network: Implement pause() using snooze() instead of cvars.
This is much simpler than the prior condvar-based method and should be functionally equivalent. It seems tsleep() cause a NULL dereference, though (which will be fixed in the next commit), so this probably also fixes #14355. Change-Id: I36968de38ceb0a1c0896cae8839821f5ca383504 Reviewed-on: https://review.haiku-os.org/489 Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
03e5dd5273
commit
6aed80b4f7
@ -36,12 +36,3 @@ wakeup(void* identifier)
|
||||
{
|
||||
publishedConditionNotifyAll(identifier);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_pause(const char* waitMessage, int timeout)
|
||||
{
|
||||
int waitChannel;
|
||||
KASSERT(timeout != 0, ("pause: timeout required"));
|
||||
return tsleep(&waitChannel, 0, waitMessage, timeout);
|
||||
}
|
||||
|
@ -5,6 +5,15 @@
|
||||
|
||||
|
||||
#include <compat/sys/systm.h>
|
||||
#include <compat/sys/kernel.h>
|
||||
|
||||
|
||||
int
|
||||
_pause(const char* waitMessage, int timeout)
|
||||
{
|
||||
KASSERT(timeout != 0, ("pause: timeout required"));
|
||||
return snooze(ticks_to_usecs(timeout));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user