Skip to content
Snippets Groups Projects
Commit 52a97972 authored by Guy Zana's avatar Guy Zana
Browse files

msleep: return EWOULDBLOCK in case of a timeout

parent b8212418
No related branches found
No related tags found
No related merge requests found
#include <map> #include <map>
#include <errno.h>
#include "debug.hh" #include "debug.hh"
#include "drivers/clock.hh" #include "drivers/clock.hh"
#include "sched.hh" #include "sched.hh"
...@@ -79,6 +80,11 @@ int synch_port::msleep(void *chan, struct mtx *mtx, ...@@ -79,6 +80,11 @@ int synch_port::msleep(void *chan, struct mtx *mtx,
return ( (t.expired()) || (wait._awake) ); return ( (t.expired()) || (wait._awake) );
}); });
// msleep timeout
if (!wait._awake) {
return (EWOULDBLOCK);
}
} else { } else {
sched::thread::wait_until(wait_lock, [&] { sched::thread::wait_until(wait_lock, [&] {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment