Wrap remaining Pipe access in lock

This commit is contained in:
Malte Rosenbjerg 2025-10-16 13:10:33 +02:00
parent 29f40b88af
commit 262c3f1b4f

View file

@ -24,12 +24,15 @@ public abstract class PipeArgument
public void Pre()
{
if (Pipe != null)
lock (_pipeLock)
{
throw new InvalidOperationException("Pipe already has been opened");
}
if (Pipe != null)
{
throw new InvalidOperationException("Pipe already has been opened");
}
Pipe = new NamedPipeServerStream(PipeName, _direction, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
Pipe = new NamedPipeServerStream(PipeName, _direction, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
}
}
public void Post()