VirtualBox

Changeset 36979 in vbox for trunk/src


Ignore:
Timestamp:
May 6, 2011 11:55:42 AM (14 years ago)
Author:
vboxsync
Message:

semfastmutex-r0drv-linux.c: Check mutex ownership in strict builds, not just builds with IPRT_DEBUG_SEMS defined.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/semfastmutex-r0drv-linux.c

    r29661 r36979  
    55
    66/*
    7  * Copyright (C) 2006-2007 Oracle Corporation
     7 * Copyright (C) 2006-2011 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3636#include <iprt/asm.h>
    3737#include <iprt/err.h>
    38 #ifdef IPRT_DEBUG_SEMS
     38#if defined(RT_STRICT) || defined(IPRT_DEBUG_SEMS)
    3939# include <iprt/thread.h>
    4040#endif
     
    5555    /** the linux semaphore. */
    5656    struct semaphore    Semaphore;
    57 #ifdef IPRT_DEBUG_SEMS
     57#if defined(RT_STRICT) || defined(IPRT_DEBUG_SEMS)
    5858    /** For check. */
    5959    RTNATIVETHREAD volatile Owner;
     
    7777    pThis->u32Magic = RTSEMFASTMUTEX_MAGIC;
    7878    sema_init(&pThis->Semaphore, 1);
    79 #ifdef IPRT_DEBUG_SEMS
     79#if defined(RT_STRICT) || defined(IPRT_DEBUG_SEMS)
    8080    pThis->Owner = NIL_RTNATIVETHREAD;
    8181#endif
     
    116116    IPRT_DEBUG_SEMS_STATE(pThis, 'd');
    117117    down(&pThis->Semaphore);
    118 #ifdef IPRT_DEBUG_SEMS
     118#if defined(RT_STRICT) || defined(IPRT_DEBUG_SEMS)
    119119    IPRT_DEBUG_SEMS_STATE(pThis, 'o');
    120120    AssertRelease(pThis->Owner == NIL_RTNATIVETHREAD);
     
    135135    AssertMsgReturn(pThis->u32Magic == RTSEMFASTMUTEX_MAGIC, ("u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
    136136
    137 #ifdef IPRT_DEBUG_SEMS
     137#if defined(RT_STRICT) || defined(IPRT_DEBUG_SEMS)
    138138    AssertRelease(pThis->Owner == RTThreadNativeSelf());
    139139    ASMAtomicUoWriteSize(&pThis->Owner, NIL_RTNATIVETHREAD);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette