VirtualBox

Changeset 25655 in vbox


Ignore:
Timestamp:
Jan 5, 2010 3:37:32 PM (15 years ago)
Author:
vboxsync
Message:

semevent-win.cpp: Moved RTEventSignal up in the file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/semevent-win.cpp

    r25653 r25655  
    55
    66/*
    7  * Copyright (C) 2006-2009 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    135135
    136136
     137RTDECL(int)  RTSemEventSignal(RTSEMEVENT EventSem)
     138{
     139    /*
     140     * Validate input.
     141     */
     142    struct RTSEMEVENTINTERNAL *pThis = EventSem;
     143    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     144    AssertReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, VERR_INVALID_HANDLE);
     145
     146#ifdef RTSEMEVENT_STRICT
     147    if (pThis->fEverHadSignallers)
     148    {
     149        int rc9 = RTLockValidatorRecSharedCheckSignaller(&pThis->Signallers, NIL_RTTHREAD);
     150        if (RT_FAILURE(rc9))
     151            return rc9;
     152    }
     153#endif
     154
     155    /*
     156     * Signal the object.
     157     */
     158    if (SetEvent(pThis->hev))
     159        return VINF_SUCCESS;
     160    DWORD dwErr = GetLastError();
     161    AssertMsgFailed(("Signaling EventSem %p failed, lasterr=%d\n", pThis, dwErr));
     162    return RTErrConvertFromWin32(dwErr);
     163}
     164
     165
    137166RTDECL(int)   RTSemEventWaitNoResume(RTSEMEVENT EventSem, unsigned cMillies)
    138167{
     
    176205        case WAIT_FAILED:
    177206        {
    178             AssertMsgFailed(("Wait on EventSem %p failed, rc=%d lasterr=%d\n", EventSem, rc, GetLastError()));
     207            AssertMsgFailed(("Wait on EventSem %p failed, rc=%d lasterr=%d\n", pThis, rc, GetLastError()));
    179208            int rc2 = RTErrConvertFromWin32(GetLastError());
    180209            if (rc2)
     
    188217
    189218
    190 RTDECL(int)  RTSemEventSignal(RTSEMEVENT EventSem)
    191 {
    192     /*
    193      * Validate input.
    194      */
    195     struct RTSEMEVENTINTERNAL *pThis = EventSem;
    196     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    197     AssertReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, VERR_INVALID_HANDLE);
    198 
    199 #ifdef RTSEMEVENT_STRICT
    200     if (pThis->fEverHadSignallers)
    201     {
    202         int rc9 = RTLockValidatorRecSharedCheckSignaller(&pThis->Signallers, NIL_RTTHREAD);
    203         if (RT_FAILURE(rc9))
    204             return rc9;
    205     }
    206 #endif
    207 
    208     /*
    209      * Signal the object.
    210      */
    211     if (SetEvent(pThis->hev))
    212         return VINF_SUCCESS;
    213     DWORD dwErr = GetLastError();
    214     AssertMsgFailed(("Signaling EventSem %p failed, lasterr=%d\n", pThis, dwErr));
    215     return RTErrConvertFromWin32(dwErr);
    216 }
    217 
    218 
    219219RTDECL(void) RTSemEventSetSignaller(RTSEMEVENT hEventSem, RTTHREAD hThread)
    220220{
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