Giter VIP home page Giter VIP logo

Comments (4)

weltkante avatar weltkante commented on July 25, 2024 1

This is not waiting on handles, it waits on a 250ms timeout or a message arriving in the message queue. Its a standard pattern to wait for new messages arriving and the timeout guarantees your polling check is executed regularly (some other places chose 100ms timeouts, 250ms is the more common timeout in WinForms).

QS_ALLINPUT should be waiting on every possible kind of message even though the name hints to input its not just that, QS_INPUT would be the one waiting for input messages

from xunit.stafact.

AArnott avatar AArnott commented on July 25, 2024

Oh yikes, I might try to deny any memory of having written that code. Yuck.
Anyway, thanks for the tip on what handles I can sleep on to do better there.

from xunit.stafact.

AArnott avatar AArnott commented on July 25, 2024

I wonder though... those handles are user input centric, which don't apply at all in a unit test. You wouldn't want your unit test to hang just because there was no one there to move the mouse. I'm going to study why I'm in a DoEvents loop at all and see if there's a better option.

from xunit.stafact.

weltkante avatar weltkante commented on July 25, 2024

The alternative would probably be pushing an ApplicationContext frame similar to what you do in WPF, and then registering a callback to the task to terminate that frame.

(If you do that you have to be aware of your callstack and make sure the task completion callback isn't inlined when you do the call to request exit of the frame, we had lock inversion issues leading to deadlocks in tests when the caller was holding some other lock and tried to exit an application frame.)

from xunit.stafact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.