nuttx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-nuttx] patacongo opened a new pull request #736: sched/pthread/pthread_condwait.c: Fix cancellation bug.
Date Sun, 05 Apr 2020 21:01:16 GMT
patacongo opened a new pull request #736: sched/pthread/pthread_condwait.c:  Fix cancellation
bug.
URL: https://github.com/apache/incubator-nuttx/pull/736
 
 
   Now that nxsem_wait_uninterruptible() returns an error when the thread is canceled, new
logic is being executed.  This revealed an existing error in pthread_cond_wait().  The nature
of the error is as follows:
   
   * pthread_cond_wait() must atomically (1) release the mutex, (2) wait on the condition,
and (3) re-establish the mutex.  Errors can occur on any of these steps.  In this case the
ECANCELED error was (very correctly) reported by nxsem_wait_uninterruptible().
   
   * However, logic in step (3) had a bug; it re-acquired the mutex, but then a bug in existing
logic cause the mutex to be improperly initialized.  Essentially, the wrong error status value
was being testing.  This resulted in a nonsequitar and errors reported by the OS test.
   
   This problem was found by apps/testing/ostest/pthread_cleanup.c

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message