Is there a way how to read the System.Thread.ThreadState property of a managed thread by Profiling API ICofProfilerInfo or IMetadataImport interface or any other way from unmanaged code?
For example something like this:
ICorProfilerInfo3 pProfilerInfo = ...;
ThreadID threadId;
pProfilerInfo->GetCurrentThreadID(&threadId);
ThreadState threadState;
pSomethingWhatINeed->GetManagedTheadState(threadId, &threadState);
if(threadState == THREADSTATE_WAIT_JOIN_SLEEP){
//do something
}