test: close diagnostic dispatch gate before signaling
This commit is contained in:
@@ -400,13 +400,16 @@ public sealed class PgmConnectDiagnosticTests
|
|||||||
|
|
||||||
public bool TryPreventKtapConnect()
|
public bool TryPreventKtapConnect()
|
||||||
{
|
{
|
||||||
PreventionAttempted.Set();
|
|
||||||
var previous = Interlocked.CompareExchange(ref _dispatchGate, 2, 0);
|
var previous = Interlocked.CompareExchange(ref _dispatchGate, 2, 0);
|
||||||
if (previous == 1 && LastKtapConnectState == PlayoutKtapConnectState.NotAttempted)
|
if (previous == 1 && LastKtapConnectState == PlayoutKtapConnectState.NotAttempted)
|
||||||
{
|
{
|
||||||
LastKtapConnectState = PlayoutKtapConnectState.Attempted;
|
LastKtapConnectState = PlayoutKtapConnectState.Attempted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Publish the test synchronization point only after the dispatch gate
|
||||||
|
// is closed. Signalling first lets the blocked safety probe resume and
|
||||||
|
// race KTAP dispatch before this prevention attempt has taken effect.
|
||||||
|
PreventionAttempted.Set();
|
||||||
return previous == 0;
|
return previous == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user