[ 
https://issues.apache.org/jira/browse/MYNEWT-879?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297715#comment-16297715
 ] 

ASF GitHub Bot commented on MYNEWT-879:
---------------------------------------

wes3 opened a new pull request #709: MYNEWT-879: OS scheduler issues with 
TAILQ_INSERT_TAIL
URL: https://github.com/apache/mynewt-core/pull/709
 
 
   kernel/os: fix errors in os_sched.c related to TAILQ_INSERT_TAIL
   
   The code needs to check if the list is empty before calling 
TAILQ_INSERT_TAIL as that macro does not set the first element in the list if 
the list is empty.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> os_sched_sleep and os_sched_insert could insert into sleep or run list 
> incorrectly
> ----------------------------------------------------------------------------------
>
>                 Key: MYNEWT-879
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-879
>             Project: Mynewt
>          Issue Type: Bug
>      Security Level: Public(Viewable by anyone) 
>          Components: OS
>    Affects Versions: v1_3_0_rel
>            Reporter: William San Filippo
>            Assignee: William San Filippo
>
> The queue.h macros TAILQ_INSERT_TAIL will not set the first element in the 
> head of the list if the list is empty. This is by design. Unfortunately, the 
> OS code does not check in two places when inserting into the sleep list 
> (os_sched_sleep) or the run list (os_sched_insert) if the list is empty. The 
> code has to specifically check if the list is empty, and if so, call 
> TAILQ_INSERT_HEAD (rather than insert tail).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to