fix deadlock
This commit is contained in:
parent
26bf6f5e02
commit
38807cc198
@ -12,6 +12,7 @@ public class Program {
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
stream.ProcessQueues();
|
stream.ProcessQueues();
|
||||||
|
Thread.Sleep(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@ public class SyncQueue<T> {
|
|||||||
if (Monitor.TryEnter(queue)) {
|
if (Monitor.TryEnter(queue)) {
|
||||||
T retval;
|
T retval;
|
||||||
|
|
||||||
Monitor.Enter(queue);
|
|
||||||
try {
|
try {
|
||||||
queue.TryDequeue(out retval);
|
queue.TryDequeue(out retval);
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user