Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Fixed thread hanling.
Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Fixed thread handling.
Added missing assert include.
Fixed missing assert include.
Added assertions and ExitThread calls.
Fixed channel closing before waiting for thread to quit.
Fixed duplicate WaitForSingleObject on client thread.
Fixed invalid event number.
Added proper thread sync for input thread.
Channels thread now listening to message pipe quit signal posted
when shutting down the channel.
Fixed input thread shutdown caused by previous commit.
Merge pull request #1460 from akallabeth/thread_handle_fixes

Thread handle fixes