Add test that triggers the former bug in ThreadLocalWaiter.emit() and ensures FIFO emit order.
This commit is contained in:
parent
a4b36f08d3
commit
100dfc30ee
|
@ -802,6 +802,30 @@ unittest {
|
|||
runEventLoop();
|
||||
}
|
||||
|
||||
unittest {
|
||||
import vibe.core.core : exitEventLoop, runEventLoop, runTask, sleep;
|
||||
|
||||
LocalManualEvent l = createManualEvent();
|
||||
|
||||
Task t2;
|
||||
runTask({
|
||||
l.wait();
|
||||
t2.interrupt();
|
||||
sleep(20.msecs);
|
||||
exitEventLoop();
|
||||
});
|
||||
t2 = runTask({
|
||||
try {
|
||||
l.wait();
|
||||
assert(false, "Shouldn't reach this.");
|
||||
} catch (InterruptException e) {}
|
||||
});
|
||||
runTask({
|
||||
l.emit();
|
||||
});
|
||||
runEventLoop();
|
||||
}
|
||||
|
||||
|
||||
/** A manually triggered multi threaded cross-task event.
|
||||
|
||||
|
|
Loading…
Reference in a new issue