[PATCH 06/11] server: Store fd reference in async object for unqueued asyncs.

Jacek Caban jacek at codeweavers.com
Mon Jun 26 05:19:28 CDT 2017


This patch stores fd pointer only for unqueued asyncs, so that we don't
need to keep reference to fd for queued (long living) ones. Queued
asyncs still use async_queue to retrieve fd reference. There are further
steps worth considering. We could always store fd in an async object,
but make it weak when async is queued (so that we'd release the
reference, keep the pointer and when fd is destroyed, we'd iterate all
still live asyncs and set the pointer to NULL). If we do that, then all
that's left in async_queue would be completion port, which is
straightforward to move to async object as well. Then async_queue could
become a regular list, not a real object. That would allow replacing
create_async_queue with something as simple and list_init and make
fd_queue_async infallible, so the code would be a bit simpler.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
---
 server/async.c  | 36 +++++++++++++++++++++++-------------
 server/change.c |  2 +-
 server/fd.c     | 10 +++++-----
 server/file.h   |  4 ++--
 4 files changed, 31 insertions(+), 21 deletions(-)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-server-Store-fd-reference-in-async-object-for-unqueue.diff
Type: text/x-patch
Size: 9862 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20170626/0222e004/attachment.bin>


More information about the wine-patches mailing list