Skip to main content
added 19 characters in body
Source Link
WBuck
  • 5.7k
  • 2
  • 30
  • 49

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphores - See this post for details.

Relevant code extract:

private static readonly SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ...   await semaphoreSlim.WaitAsync();  try {  await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphores - See this post for details.

Relevant code extract:

static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ... await semaphoreSlim.WaitAsync(); try { await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphores - See this post for details.

Relevant code extract:

private static readonly SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ...   await semaphoreSlim.WaitAsync();  try {  await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphonessemaphores - See this post for details:

https://blog.cdemi.io/async-waiting-inside-c-sharp-locks/See this post for details.

Relevant code extract:

static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ... await semaphoreSlim.WaitAsync(); try { await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphones - See this post for details:

https://blog.cdemi.io/async-waiting-inside-c-sharp-locks/

Relevant code extract:

static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ... await semaphoreSlim.WaitAsync(); try { await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphores - See this post for details.

Relevant code extract:

static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ... await semaphoreSlim.WaitAsync(); try { await Task.Delay(1000); } finally { semaphoreSlim.Release(); } 
Source Link
user851220
  • 1.7k
  • 2
  • 10
  • 7

This has been disallowed to stop deadlocks (i.e. developers hurting themselves). The best solution I've found is to use semaphones - See this post for details:

https://blog.cdemi.io/async-waiting-inside-c-sharp-locks/

Relevant code extract:

static SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); ... await semaphoreSlim.WaitAsync(); try { await Task.Delay(1000); } finally { semaphoreSlim.Release(); }