diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2019-05-14 15:10:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 15:10:17 -0700 |
commit | fd2287c5e833439e0ea7c27ad14350bcccf371a0 (patch) | |
tree | 738e1dec19d4402f070a1e6ebcf04cc7a255e300 /src/vm/comthreadpool.cpp | |
parent | 5f09000ba82d21e04857941b9a087679dd0ea686 (diff) | |
download | coreclr-fd2287c5e833439e0ea7c27ad14350bcccf371a0.tar.gz coreclr-fd2287c5e833439e0ea7c27ad14350bcccf371a0.tar.bz2 coreclr-fd2287c5e833439e0ea7c27ad14350bcccf371a0.zip |
Fix a contract violation in ThreadPool.get_CompletedWorkItemCount (#24535)
Fix a contract violation in ThreadPool.get_CompletedWorkItemCount
Fixes https://github.com/dotnet/coreclr/issues/24515
- Looks like the path that acquires the thread store lock has code that is marked witH GC_TRIGGERS
- Changed ThreadPool.get_CompletedWorkItemCount and Monitor.get_LockContentionCount to use QCalls instead of FCalls
Diffstat (limited to 'src/vm/comthreadpool.cpp')
-rw-r--r-- | src/vm/comthreadpool.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/vm/comthreadpool.cpp b/src/vm/comthreadpool.cpp index f5dc4233e0..8a1f887086 100644 --- a/src/vm/comthreadpool.cpp +++ b/src/vm/comthreadpool.cpp @@ -190,12 +190,19 @@ FCIMPL0(INT32, ThreadPoolNative::GetThreadCount) FCIMPLEND /*****************************************************************************************************/ -FCIMPL0(INT64, ThreadPoolNative::GetCompletedWorkItemCount) +INT64 QCALLTYPE ThreadPoolNative::GetCompletedWorkItemCount() { - FCALL_CONTRACT; - return (INT64)Thread::GetTotalThreadPoolCompletionCount(); + QCALL_CONTRACT; + + INT64 result = 0; + + BEGIN_QCALL; + + result = (INT64)Thread::GetTotalThreadPoolCompletionCount(); + + END_QCALL; + return result; } -FCIMPLEND /*****************************************************************************************************/ FCIMPL0(INT64, ThreadPoolNative::GetPendingUnmanagedWorkItemCount) |