Console.ReadLine Abort

  • Thread starter Thread starter leszek.doniec
  • Start date Start date
L

leszek.doniec

Hello,

Is there any possibility to Abort a thread that is stopped on
Console.ReadLine() call?

Environment.Exit() is not a solution for me, unfortunately.

Thanks in advance for any hints.
Leszek Doniec
 
Why do you use ReadLine() if you don't expect someone to type anything on
the Keybord? Much better is to let your thread wait on an event, when you
want to terminate that thread you 'Set' the event state to signalled and
your thread can resume or terminate you name it.
Take a look at the WaitHandle class for more details.

Willy.


| Hello,
|
| Is there any possibility to Abort a thread that is stopped on
| Console.ReadLine() call?
|
| Environment.Exit() is not a solution for me, unfortunately.
|
| Thanks in advance for any hints.
| Leszek Doniec
|
 
I expect to receive commands from the console. In case of some faults
in other threads I want to stop the thread that is stopped on ReadLine,
without exitting the application.

Is there a possibility to obtain thread handle (to use API command to
abort the thread)?

Regards,
Leszek
 
Back
Top