Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

tty_yield(0)?

May
12,846
164
I have often used tty_yield(0) in a loop while waiting for something to happen, and wanting thread messages to be processed (e.g., if I have SetWinEventHook() and I'm waiting for the hook process to SetEvent()).

For that purpose, I find that (simply)

Code:
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)

works as well. I'm curious ... what else does tty_yield(0) do?
 
I have often used tty_yield(0) in a loop while waiting for something to happen, and wanting thread messages to be processed (e.g., if I have SetWinEventHook() and I'm waiting for the hook process to SetEvent()).

For that purpose, I find that (simply)

Code:
PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)

works as well. I'm curious ... what else does tty_yield(0) do?

Nothing, if you pass 0. If you pass 1, it's a whole different ballgame. (But that's not anything you should be doing anyway!)
 
Back
Top