dchestnutt
June 24th, 2005, 03:26 PM
I'm piping Console.In to another process (started by my main process). In my Thread, I'm doing it character by character, something like this:
[In ThreadStart method]
while ( m_continue ) {
int readChar = Console.In.Read();
m_writer.Write( (char)readChar );
m_writer.Flush();
}
When the subprocess goes away, the main thread does this:
[In main thread]
m_continue = false;
m_thread.Interrupt();
Unfortunately, the thread stays blocked on the Read(). I've tried Thread.Abort(), and that doesn't unblock the Read either.
Any suggestions?
Thanks.
[In ThreadStart method]
while ( m_continue ) {
int readChar = Console.In.Read();
m_writer.Write( (char)readChar );
m_writer.Flush();
}
When the subprocess goes away, the main thread does this:
[In main thread]
m_continue = false;
m_thread.Interrupt();
Unfortunately, the thread stays blocked on the Read(). I've tried Thread.Abort(), and that doesn't unblock the Read either.
Any suggestions?
Thanks.