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

net: fix race in netisr worker thread

move have more work mark before the handler, during the handler execution
another thread may signal the netisr worker thread, avoids a race.
parent cfe1d98c
No related branches found
No related tags found
No related merge requests found
...@@ -26,9 +26,9 @@ void netisr_osv_thread_wrapper(netisr_osv_handler_t handler, void* arg) ...@@ -26,9 +26,9 @@ void netisr_osv_thread_wrapper(netisr_osv_handler_t handler, void* arg)
{ {
while (1) { while (1) {
sched::thread::wait_until([&] { return (netisr_osv_have_work); }); sched::thread::wait_until([&] { return (netisr_osv_have_work); });
netisr_osv_have_work = 0;
handler(arg); handler(arg);
netisr_osv_have_work = 0;
} }
} }
......
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