简体   繁体   中英

Can I use a SynchronizationContext to post or send work to a thread currently running a message pump?

If I have a thread for which I run:

Application.Run();

If I post or send work to that thread, will the work be run in that thread?

* Edit for a bit more information.

The exact use case is as follows. If I pulled the SynchronizationContext off of a Forms UI thread. If I posted or sent work to that thread using the Post() or Send() methods of the SynchronizationContext object, would the UI thread execute that work or is there some other mechanism by which that work executes?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM