On 01.12.2016 12:52, Alexandre Julliard wrote:
Jacek Caban jacek@codeweavers.com writes:
We'd probably need to clear them explicitly at process exit.
I agree that we should. I will send a new series implementing that. I tested that with the attached patch (I can't send it to wine-patches yet because it uses pipes in message mode).
Thread exit would be interesting to test too.
I tested that and it seems that Windows aborts asyncs on thread exit. It's easy to implement aborting itself in Wine, but I must admit that I have very mixed feelings about it.
I would expect to be able to initialize an async I/O in one thread and handle its completion in another. That's how threadpool - based applications are likely to work and, maybe not literally, but [1] gives an impression that it's supported. I tried to test threadpool with the attached test, but it throws an exception in TerminateThread call, not allowing me to terminate that thread. That makes me think that it supports splitting async I/O between threads by heavily ensuring that affected threads are not terminated. We don't have something like that in Wine and I find it very risky to implement async cancellation on thread exit at this point.
Thanks, Jacek
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms686760(v=vs.85).a...