You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2017/11/07 16:09:50 UTC

[GitHub] mkiiskila closed pull request #648: No lock accounting for semaphores

mkiiskila closed pull request #648: No lock accounting for semaphores
URL: https://github.com/apache/mynewt-core/pull/648
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/kernel/os/src/os_sem.c b/kernel/os/src/os_sem.c
index 02fecbfe0..7566087a6 100644
--- a/kernel/os/src/os_sem.c
+++ b/kernel/os/src/os_sem.c
@@ -99,9 +99,6 @@ os_sem_release(struct os_sem *sem)
     if (rdy) {
         /* Clear flag that we are waiting on the semaphore; wake up task */
         rdy->t_flags &= ~OS_TASK_FLAG_SEM_WAIT;
-        /* Could do this after being woken up in os_sem_pend() */
-        rdy->t_lockcnt++;
-        rdy->t_flags |= OS_TASK_FLAG_LOCK_HELD;
         os_sched_wakeup(rdy);
 
         /* Schedule if waiting task higher priority */
@@ -112,9 +109,6 @@ os_sem_release(struct os_sem *sem)
         /* Add to the number of tokens */
         sem->sem_tokens++;
     }
-    if (--current->t_lockcnt == 0) {
-        current->t_flags &= ~OS_TASK_FLAG_LOCK_HELD;
-    }
 
     OS_EXIT_CRITICAL(sr);
 
@@ -174,8 +168,6 @@ os_sem_pend(struct os_sem *sem, uint32_t timeout)
      */
     if (sem->sem_tokens != 0) {
         sem->sem_tokens--;
-        current->t_lockcnt++;
-        current->t_flags |= OS_TASK_FLAG_LOCK_HELD;
         rc = OS_OK;
     } else if (timeout == 0) {
         rc = OS_TIMEOUT;


 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services