BUG/MINOR: stream: flag TASK_WOKEN_RES not set if task in runqueue
Under certain circumstances, if a stream's task is first woken up
(eg: I/O event) then notified of the availability of a buffer it
was waiting for via stream_res_wakeup(), this second event is lost
because the flags are only merged after seeing that the task is
running. At the moment it seems that the TASK_WOKEN_RES event is
not explicitly checked for, but better fix this before getting
reports of lost events.
This fix removes this "task running" test which is properly
performed in task_wakeup(), while the flags are properly merged.
It must be backported to 1.7 and 1.6.
diff --git a/include/proto/stream.h b/include/proto/stream.h
index 85c234e..5ff2291 100644
--- a/include/proto/stream.h
+++ b/include/proto/stream.h
@@ -286,7 +286,7 @@
* it returns 0. */
static int inline stream_res_wakeup(struct stream *s)
{
- if (s->task->state & TASK_RUNNING || task_in_rq(s->task))
+ if (s->task->state & TASK_RUNNING)
return 0;
task_wakeup(s->task, TASK_WOKEN_RES);
return 1;