w32: Change the way the I/O threads are cleaned up.
authorWerner Koch <wk@gnupg.org>
Thu, 25 Apr 2013 11:00:16 +0000 (12:00 +0100)
committerWerner Koch <wk@gnupg.org>
Sat, 11 May 2013 13:38:08 +0000 (15:38 +0200)
commit9e7df9aa6d81f0abbabb03a2346d80eb5d375f81
treec795a288f6612141b118cbb966546750d79505e5
parent9f330be8210d2498fe93d4166b6f6c02fca76475
w32: Change the way the I/O threads are cleaned up.

* src/w32-io.c (reader_context_s, create_reader)
(writer_context_s, create_writer): Rename STOPPED to CLOSE_EV.
(reader, writer): Remove setting of STOPPED.  Wait for CLOSE_EV and
then release the context.
(destroy_reader, destroy_writer): Do not wait but set the CLOSE_EV.
(kill_reader, kill_writer): Remove.
(_gpgme_io_close): Add code from kill_reader and kill_writer.
--

The old code was prone to deadlocks which were actually exhibited at
Kleopatra startup.  The new code is much more straightforward and
easier to understand.  The reason for the complex old code was
probably due to our former idea to allow re-use of the I/O threads.
However we have long given up on this.
src/w32-io.c