Cancelling getchar()
===

I've got a small program that does a large amount of processing. The progress of which you can get a print of by hitting the enter key.

The way I've implemented this is by having the processing done in the main thread whilst I have a pthread constantly looping on getchar() to wait for the enter key.

The problem is when I have finished with the processing. When this happens the main thread finishes, but still waits for enter to be pressed because getchar() is blocking.

How do I "cancel" getchar()?