VirtualBox

Changeset 25398 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Dec 15, 2009 12:58:08 PM (15 years ago)
Author:
vboxsync
Message:

IPRT,PDMAllocCritSect: Don't bitch when recursivly entering a mutex.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/lockvalidator.h

    r25373 r25398  
    166166RTDECL(int)  RTLockValidatorCheckOrder(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    167167
    168 
    169 /**
    170  * Record the specified thread as lock owner.
    171  *
    172  * This is typically called after acquiring the lock.
    173  *
    174  * @returns hThread resolved.  Can return NIL_RTHREAD iff we fail to adopt the
    175  *          alien thread or if pRec is invalid.
     168/**
     169 * Check the exit order.
     170 *
     171 * This is called by routines implementing lock acquisition.
     172 *
     173 * @retval  VINF_SUCCESS on success.
     174 * @retval  VERR_DEADLOCK if the order is wrong, after having whined and
     175 *          asserted.
    176176 *
    177177 * @param   pRec                The validator record.
     
    187187 *                              from.  Optional.
    188188 */
     189RTDECL(int)  RTLockValidatorCheckReleaseOrder(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread);
     190
     191/**
     192 * Record the specified thread as lock owner.
     193 *
     194 * This is typically called after acquiring the lock.
     195 *
     196 * @returns hThread resolved.  Can return NIL_RTHREAD iff we fail to adopt the
     197 *          alien thread or if pRec is invalid.
     198 *
     199 * @param   pRec                The validator record.
     200 * @param   hThread             The handle of the calling thread.  If not known,
     201 *                              pass NIL_RTTHREAD and this method will figure it
     202 *                              out.
     203 * @param   uId                 Some kind of locking location ID.  Typically a
     204 *                              return address up the stack.  Optional (0).
     205 * @param   pszFile             The file where the lock is being acquired from.
     206 *                              Optional.
     207 * @param   iLine               The line number in that file.  Optional (0).
     208 * @param   pszFunction         The functionn where the lock is being acquired
     209 *                              from.  Optional.
     210 */
    189211RTDECL(RTTHREAD) RTLockValidatorSetOwner(PRTLOCKVALIDATORREC pRec, RTTHREAD hThread, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    190212
  • trunk/include/iprt/thread.h

    r25373 r25398  
    632632 * Unblocks a thread.
    633633 *
    634  * This function is paired with rtThreadBlocking.
     634 * This function is paired with RTThreadBlocking and RTThreadBlockingDebug.
    635635 *
    636636 * @param   hThread     The current thread.
     
    641641
    642642/**
     643 * Change the thread state to blocking.
     644 *
     645 * @param   hThread         The current thread.
     646 * @param   enmState        The sleep state.
     647 */
     648RTDECL(void) RTThreadBlocking(RTTHREAD hThread, RTTHREADSTATE enmState);
     649
     650/**
    643651 * Change the thread state to blocking and do deadlock detection.
    644652 *
     
    648656 * @param   enmState        The sleep state.
    649657 * @param   pvBlock         Pointer to a RTLOCKVALIDATORREC structure.
     658 * @param   fRecursiveOk    Whether it's ok to recurse.
    650659 * @param   uId             Where we are blocking.
    651660 * @param   RT_SRC_POS_DECL Where we are blocking.
    652  */
    653 RTDECL(void) RTThreadBlocking(RTTHREAD hThread, RTTHREADSTATE enmState,
    654                               PRTLOCKVALIDATORREC pValidatorRec, RTHCUINTPTR uId, RT_SRC_POS_DECL);
     661 *
     662 * @todo    Move this to RTLockValidator.
     663 */
     664RTDECL(void) RTThreadBlockingDebug(RTTHREAD hThread, RTTHREADSTATE enmState, bool fRecursiveOk,
     665                                   PRTLOCKVALIDATORREC pValidatorRec, RTHCUINTPTR uId, RT_SRC_POS_DECL);
    655666
    656667
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