Changeset faf3ff8f in rtems


Ignore:
Timestamp:
Mar 19, 2015, 7:55:01 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
e0a25fb
Parents:
da30417b
Message:

score: Fix _Debug_Is_owner_of_allocator()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/debugisownerofallocator.c

    rda30417b rfaf3ff8f  
    11/*
    2  * Copyright (c) 2014 embedded brains GmbH.  All rights reserved.
     2 * Copyright (c) 2014-2015 embedded brains GmbH.  All rights reserved.
    33 *
    44 *  embedded brains GmbH
     
    2020#include <rtems/score/apimutex.h>
    2121#include <rtems/score/thread.h>
     22#include <rtems/score/threaddispatch.h>
    2223
    2324#if defined( RTEMS_DEBUG )
     
    2728    bool owner;
    2829
     30    /*
     31     * We have to synchronize with the _CORE_mutex_Surrender() operation,
     32     * otherwise we may observe an outdated mutex holder.
     33     */
     34    _Thread_Disable_dispatch();
     35
    2936    if ( mutex != NULL ) {
    30       owner = mutex->Mutex.holder == _Thread_Get_executing();
     37      owner = mutex->Mutex.holder == _Thread_Executing;
    3138    } else {
    3239      owner = false;
    3340    }
    3441
     42    _Thread_Enable_dispatch();
     43
    3544    return owner;
    3645  }
Note: See TracChangeset for help on using the changeset viewer.