diff options
author | Koundinya Veluri <kouvel@users.noreply.github.com> | 2019-03-15 09:12:27 -0700 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2019-03-15 12:12:27 -0400 |
commit | 9c4d496071c2ffdc5a8793835694d1a8ac267522 (patch) | |
tree | 21bb9a61b173fcf81d28799429a5d38ae056a442 | |
parent | 52311794f86596eeeedb745fc2258edd0eeafb95 (diff) | |
download | coreclr-9c4d496071c2ffdc5a8793835694d1a8ac267522.tar.gz coreclr-9c4d496071c2ffdc5a8793835694d1a8ac267522.tar.bz2 coreclr-9c4d496071c2ffdc5a8793835694d1a8ac267522.zip |
In CLRLifoSemaphore, start the underlying semaphore with 0 for the initial signal count (#22632)
- Port of a fix from https://github.com/dotnet/corert/pull/6955
- The underlying semaphore is only used to wake up waiters, initially there are no waiters and the signal count should be zero. This was already the case on Windows, this fixes the Unix side. The actual initial signal count is tracked in the upper layer counts.
- The initial signal count passed in is zero anyway in the places where it's used, so it makes no difference for now, just some cleanup
-rw-r--r-- | src/vm/synch.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vm/synch.cpp b/src/vm/synch.cpp index 13f6ff3d28..55d42d73f5 100644 --- a/src/vm/synch.cpp +++ b/src/vm/synch.cpp @@ -589,7 +589,7 @@ void CLRLifoSemaphore::Create(INT32 initialSignalCount, INT32 maximumSignalCount _ASSERTE(m_handle == nullptr); #ifdef FEATURE_PAL - HANDLE h = UnsafeCreateSemaphore(nullptr, initialSignalCount, maximumSignalCount, nullptr); + HANDLE h = UnsafeCreateSemaphore(nullptr, 0, maximumSignalCount, nullptr); #else // !FEATURE_PAL HANDLE h = CreateIoCompletionPort(INVALID_HANDLE_VALUE, nullptr, 0, maximumSignalCount); #endif // FEATURE_PAL |