diff options
author | Rodrigo Kumpera <kumpera@users.noreply.github.com> | 2017-11-16 11:29:15 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-11-16 11:29:15 +0300 |
commit | 375471820c02ff0bab025bff75b5da7efc95d3cd (patch) | |
tree | d732d7ef2c377fbc43f586e85c4d948fa85e7068 /mcs/class/referencesource | |
parent | c0f6935b45a91829133869e1828ee47eb890055a (diff) |
[corlib] Don't capture the execution context when UnsafeRegisterWaitForSingleObject is used. Fixes #60029 (#6013)
Diffstat (limited to 'mcs/class/referencesource')
-rw-r--r-- | mcs/class/referencesource/mscorlib/system/threading/threadpool.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs index b51c8755e74..6def21787d6 100644 --- a/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs +++ b/mcs/class/referencesource/mscorlib/system/threading/threadpool.cs @@ -1507,7 +1507,10 @@ namespace System.Threading throw new NotSupportedException ("Timeout is too big. Maximum is Int32.MaxValue"); RegisteredWaitHandle waiter = new RegisteredWaitHandle (waitObject, callBack, state, new TimeSpan (0, 0, 0, 0, (int) millisecondsTimeOutInterval), executeOnlyOnce); - QueueUserWorkItem (new WaitCallback (waiter.Wait), null); + if (compressStack) + QueueUserWorkItem (new WaitCallback (waiter.Wait), null); + else + UnsafeQueueUserWorkItem (new WaitCallback (waiter.Wait), null); return waiter; #endif |