17 references to semaphore
System.Data (17)
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (17)
226
Monitor.Enter(
semaphore
); // semaphore is used as lock object, no relation to SemaphoreSlim.Wait/Release methods
227
if (canReleaseFromAnyThread ||
semaphore
.CurrentCount==0) {
228
semaphore
.Wait();
230
Monitor.Exit(
semaphore
);
233
semaphore
.Release();
242
Monitor.TryEnter(
semaphore
, timeout, ref hasMonitor); // semaphore is used as lock object, no relation to SemaphoreSlim.Wait/Release methods
244
if ((canReleaseFromAnyThread) || (
semaphore
.CurrentCount == 0)) {
245
if (
semaphore
.Wait(timeout)) {
247
Monitor.Exit(
semaphore
);
251
semaphore
.Release();
264
Monitor.Exit(
semaphore
);
271
if (
semaphore
.CurrentCount==0) { // semaphore methods were used for locking
272
semaphore
.Release();
275
Monitor.Exit(
semaphore
);
282
return
semaphore
.CurrentCount==0;
288
return Monitor.IsEntered(
semaphore
) ||
semaphore
.CurrentCount == 0;