rtems-bsd-mutex: Fix resource count updates

This commit is contained in:
Sebastian Huber 2015-06-23 08:58:58 +02:00
parent b9fb1ef331
commit b22ad9f4c5
2 changed files with 2 additions and 1 deletions

View File

@ -79,10 +79,10 @@ rtems_bsd_mutex_lock(struct lock_object *lock, rtems_bsd_mutex *m)
owner = m->owner;
executing = _Thread_Executing;
++executing->resource_count;
if (__predict_true(owner == NULL)) {
m->owner = executing;
++executing->resource_count;
_Thread_queue_Release(&m->queue, &lock_context);
} else {

View File

@ -57,6 +57,7 @@ rtems_bsd_mutex_lock_more(struct lock_object *lock, rtems_bsd_mutex *m,
/* Priority inheritance */
_Thread_Raise_priority(owner, executing->current_priority);
++executing->resource_count;
_Thread_queue_Enqueue_critical(&m->queue, executing,
STATES_WAITING_FOR_MUTEX, WATCHDOG_NO_TIMEOUT, 0,
lock_context);