Share via


ICorDebugHeapValue3::GetThreadOwningMonitorLock Method

Returns the managed thread that owns the monitor lock on this object.

HRESULT GetThreadOwningMonitorLock (
    [out] ICorDebugThread   **ppThread,
    [out] DWORD              *pAcquisitionCount
);

Parameters

  • ppThread
    [out] The managed thread that owns the monitor lock on this object.

  • pAcquisitionCount
    [out] The number of times this thread would have to release the lock before it returns to being unowned.

Return Value

This method returns the following specific HRESULTs as well as HRESULT errors that indicate method failure.

HRESULT

Description

S_OK

The method completed successfully.

S_FALSE

No managed thread owns the monitor lock on this object.

Remarks

If a managed thread owns the monitor lock on this object:

  • The method returns S_OK.

  • The thread object is valid until the thread exits.

If no managed thread owns the monitor lock on this object, ppThread and pAcquisitionCount are unchanged, and the method returns S_FALSE.

If ppThread or pAcquisitionCount is not a valid pointer, the result is undefined.

If an error occurs such that it cannot be determined which, if any, thread owns the monitor lock on this object, the method returns an HRESULT that indicates failure.

Requirements

Platforms: See .NET Framework System Requirements.

Header: CorDebug.idl, CorDebug.h

Library: CorGuids.lib

.NET Framework Versions: 4

See Also

Other Resources

Debugging Interfaces

Debugging (Unmanaged API Reference)