From cf85f56e473b6cdc4a68e9758f57dc571e14c9cb Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 25 Feb 2019 18:28:46 +0100 Subject: Move WaitHandle to shared CoreLib (#22634) * Move part of WaitHandle to shared CoreLib * Bring back OpenExistingResult to fix build * Move reminder of WaitHandle to shared, implement SynchronizationContext logic in managed code, handle SafeHandle referencing in managed code * Update with changes neeeded for CoreRT * Span -> ReadOnlySpan * Remove dead code * Fix SafeHandle error handling * Avoid double check on input values in WaitHandle.WaitOne overloads * Make OpenExistingResult private protected instead of internal * Make WaitHandle._waitHandle private * Code style fixes * Remove unnecessary GC.KeepAlive * Move ERROR_TOO_MANY_POSTS exception handling to CoreCLR specific code * Add cache for wait arrays to match previous CoreRT behavior and reduce GC pressure, change unmanaged code to allocate small array on stack * Address PR feedback * Reduce allocations/copying by moving stack allocation to managed code * Address PR feedback * Minor code reshuffle * Move thread local access close to each other * Address code style feedback * Add const to Wait* constants --- src/vm/comwaithandle.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/vm/comwaithandle.h') diff --git a/src/vm/comwaithandle.h b/src/vm/comwaithandle.h index 816af13e9b..218446881a 100644 --- a/src/vm/comwaithandle.h +++ b/src/vm/comwaithandle.h @@ -19,9 +19,8 @@ class WaitHandleNative { public: - static FCDECL3(INT32, CorWaitOneNative, SafeHandle* safeWaitHandleUNSAFE, INT32 timeout, CLR_BOOL exitContext); - static FCDECL4(INT32, CorWaitMultipleNative, Object* waitObjectsUNSAFE, INT32 timeout, CLR_BOOL exitContext, CLR_BOOL waitForAll); - static FCDECL4(INT32, CorSignalAndWaitOneNative, SafeHandle* safeWaitHandleSignalUNSAFE, SafeHandle* safeWaitHandleWaitUNSAFE, INT32 timeout, CLR_BOOL exitContext); - static FCDECL3(DWORD, WaitHelper, PTRArray *handleArrayUNSAFE, CLR_BOOL waitAll, DWORD millis); + static FCDECL2(INT32, CorWaitOneNative, HANDLE handle, INT32 timeout); + static FCDECL4(INT32, CorWaitMultipleNative, HANDLE *handleArray, INT32 numHandles, CLR_BOOL waitForAll, INT32 timeout); + static FCDECL3(INT32, CorSignalAndWaitOneNative, HANDLE waitHandleSignalUNSAFE, HANDLE waitHandleWaitUNSAFE, INT32 timeout); }; #endif -- cgit v1.2.3