andrzej-kaczmarek commented on code in PR #3117:
URL: https://github.com/apache/mynewt-core/pull/3117#discussion_r1419751386


##########
kernel/os/src/os_eventq.c:
##########
@@ -69,7 +69,8 @@ os_eventq_put(struct os_eventq *evq, struct os_event *ev)
          * Check if task is sleeping, because another event
          * queue may have woken this task up beforehand.
          */
-        if (evq->evq_task->t_state == OS_TASK_SLEEP) {
+        if (evq->evq_task->t_state == OS_TASK_SLEEP &&
+            evq->evq_task->t_flags & OS_TASK_FLAG_EVQ_WAIT) {

Review Comment:
   > So, what this change does is it forces the scheduler to be blocked on the 
semaphore even though an event is scheduled if thats what the task has been 
waiting for.
   
   This is exactly what's impossible here: task cannot be blocked on semaphore 
and wait for an event at the same time.
   
   The condition you modify is only executed if `evq->evq_task != NULL` and 
this is only valid if task is blocked on `os_eventq_get`. If you have task 
blocked on a semaphore which is also set as `evq_task` in some eventq then 
something is broken elsewhere.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to