VirtualBox

Changeset 40103 in vbox for trunk/src/VBox/Runtime/r3


Ignore:
Timestamp:
Feb 13, 2012 5:57:39 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
76244
Message:

Runtime/semeventmulti-posix.cpp: Fix bug which causes that a VERR_SEM_DESTROYED error code is not passed to the caller, also use distinct variables for posix status codes and iprt status codes because they are not distinct. Add RT_UNLIKELY for error case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp

    r39083 r40103  
    319319     * Validate input.
    320320     */
     321    int rc = VINF_SUCCESS;
    321322    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
    322323    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     
    327328     * Lock the mutex semaphore.
    328329     */
    329     int rc = pthread_mutex_lock(&pThis->Mutex);
    330     if (rc)
    331     {
    332         AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
    333         return RTErrConvertFromErrno(rc);
     330    int rcPosix = pthread_mutex_lock(&pThis->Mutex);
     331    if (RT_UNLIKELY(rcPosix))
     332    {
     333        AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", hEventMultiSem, rcPosix));
     334        return RTErrConvertFromErrno(rcPosix);
    334335    }
    335336
     
    345346     * Release the mutex and return.
    346347     */
    347     rc = pthread_mutex_unlock(&pThis->Mutex);
    348     if (rc)
    349     {
    350         AssertMsgFailed(("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
    351         return RTErrConvertFromErrno(rc);
    352     }
    353 
    354     return VINF_SUCCESS;
    355 
     348    rcPosix = pthread_mutex_unlock(&pThis->Mutex);
     349    if (RT_UNLIKELY(rcPosix))
     350    {
     351        AssertMsgFailed(("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rcPosix));
     352        return RTErrConvertFromErrno(rcPosix);
     353    }
     354
     355    return rc;
    356356}
    357357
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