VirtualBox

Changeset 22959 in vbox


Ignore:
Timestamp:
Sep 11, 2009 1:45:44 PM (15 years ago)
Author:
vboxsync
Message:

sem*-linux.cpp,Makefile.kmk: Added check for cMillies==0 in RTSemEvent and introduced a build config variable IPRT_WITH_FUTEX_BASED_SEMS. Corrected comment in semeventmulti about the futex variable values.

Location:
trunk/src/VBox/Runtime
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/Makefile.kmk

    r22777 r22959  
    183183ifdef IPRT_WITH_LZO
    184184 RuntimeR3_DEFS         += RTZIP_USE_LZO
     185endif
     186ifdef IPRT_WITH_FUTEX_BASED_SEMS
     187 RuntimeR3_DEFS.linux   += IPRT_WITH_FUTEX_BASED_SEMS
    185188endif
    186189RuntimeR3_INCS          = \
     
    445448        r3/posix/tls-posix.cpp \
    446449        r3/posix/utf8-posix.cpp
    447 RuntimeR3_SOURCES.linux.x86 += \
    448         r3/posix/semevent-posix.cpp \
    449         r3/posix/semeventmulti-posix.cpp \
    450         r3/posix/semmutex-posix.cpp
    451 RuntimeR3_SOURCES.linux.amd64 += \
    452         r3/linux/semevent-linux.cpp \
    453         r3/linux/semeventmulti-linux.cpp
    454 ifdef RT_NEW_LINUX_MUTEX_CODE
     450ifdef IPRT_WITH_FUTEX_BASED_SEMS
     451 RuntimeR3_SOURCES.linux += \
     452        r3/linux/semevent-linux.cpp \
     453        r3/linux/semeventmulti-linux.cpp \
     454        r3/linux/semmutex-linux.cpp
     455else
     456 RuntimeR3_SOURCES.linux.x86 += \
     457        r3/posix/semevent-posix.cpp \
     458        r3/posix/semeventmulti-posix.cpp \
     459        r3/posix/semmutex-posix.cpp
    455460 RuntimeR3_SOURCES.linux.amd64 += \
    456         r3/linux/semmutex-linux.cpp
    457 else
    458  RuntimeR3_SOURCES.linux.amd64 += \
    459         r3/posix/semmutex-posix.cpp
     461        r3/linux/semevent-linux.cpp \
     462        r3/linux/semeventmulti-linux.cpp
     463 ifdef RT_NEW_LINUX_MUTEX_CODE
     464  RuntimeR3_SOURCES.linux.amd64 += \
     465        r3/linux/semmutex-linux.cpp
     466 else
     467  RuntimeR3_SOURCES.linux.amd64 += \
     468        r3/posix/semmutex-posix.cpp
     469 endif
    460470endif
    461471
  • trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp

    r22958 r22959  
    3030
    3131#include <features.h>
    32 #if __GLIBC_PREREQ(2,6)
     32#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS)
    3333
    3434/*
     
    8383    /** The futex state variable.
    8484     * 0 means not signalled.
    85      * 1 means signalled */
     85       1 means signalled. */
    8686    uint32_t volatile   fSignalled;
    8787    /** The number of waiting threads */
     
    195195
    196196    /*
    197      * Convert timeout value.
     197     * Convert the timeout value.
    198198     */
    199199    struct timespec ts;
     
    202202    if (cMillies != RT_INDEFINITE_WAIT)
    203203    {
     204        if (!cMillies)
     205            return VERR_TIMEOUT;
    204206        ts.tv_sec  = cMillies / 1000;
    205207        ts.tv_nsec = (cMillies % 1000) * 1000000;
     
    282284}
    283285
    284 #endif /* glibc < 2.6 */
     286#endif /* glibc < 2.6 || IPRT_WITH_FUTEX_BASED_SEMS */
     287
  • trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp

    r22958 r22959  
    3131
    3232#include <features.h>
    33 #if __GLIBC_PREREQ(2,6)
     33#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS)
    3434
    3535/*
     
    8686     * -1 means signaled.
    8787     *  0 means not signaled, no waiters.
    88      * >0 means not signaled, and the value gives the number of waiters.
     88     *  1 means not signaled and that someone is waiting.
    8989     */
    9090    int32_t volatile    iState;
     
    212212    if (iCur == -1)
    213213        return VINF_SUCCESS;
    214     if (!cMillies)
    215         return VERR_TIMEOUT;
    216 
    217     /*
    218      * Convert timeout value.
     214
     215    /*
     216     * Convert the timeout value.
    219217     */
    220218    struct timespec ts;
     
    223221    if (cMillies != RT_INDEFINITE_WAIT)
    224222    {
     223        if (!cMillies)
     224            return VERR_TIMEOUT;
    225225        ts.tv_sec  = cMillies / 1000;
    226226        ts.tv_nsec = (cMillies % 1000) * 1000000;
     
    300300}
    301301
    302 #endif /* glibc < 2.6 */
     302#endif /* glibc < 2.6 || IPRT_WITH_FUTEX_BASED_SEMS */
     303
  • trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp

    r22958 r22959  
    3838#include <iprt/asm.h>
    3939#include <iprt/err.h>
     40#include <iprt/time.h>
    4041#include "internal/magics.h"
    4142#include "internal/strict.h"
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