w32: Revamp the closing of system objects.
authorWerner Koch <wk@gnupg.org>
Fri, 2 Nov 2018 08:14:07 +0000 (09:14 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 2 Nov 2018 08:14:58 +0000 (09:14 +0100)
commitda89528ac39b687bfbed2209ca2637e3bd8e0ac5
tree56574de5fe8e933eb8ce755519cab7c54bfbd029
parent337c10825525d4084f3f437fde5af3806707e6a4
w32: Revamp the closing of system objects.

* src/w32-io.c (hddesc_t): New.
(reader_context_s, writer_context_s): Replace file_sock and file_hd by
the hddesc_t hdd.
(fd_table): Ditto.  Add want_reader and want_writer.
(hddesc_lock): New lock variable.
(new_hddesc, ref_hddesc): New.
(release_hddesc): New.
(reader, writer): Call release_hddesc.
(create_reader, create_writer): Change for new hddesc scheme.
(destroy_reader, destroy_writer): Replace closing by a call to
release_hddesc.
(_gpgme_io_pipe): Change for new hddesc scheme.
(_gpgme_io_close): Ditto.
(_gpgme_io_dup): Ditto.  Use want_reader and want_writer.
(_gpgme_io_socket): Change for new hddesc scheme.
--

GnuPG-bug-id: 4237
Signed-off-by: Werner Koch <wk@gnupg.org>
src/w32-io.c