Quote Originally Posted by Bubba View Post
Yes I thought about that after posting it. PostMessage or a callback would be better. But it's not because any of the functions are not thread-safe per se but moreso because SendMessage is like a 'blocking' call.
But that's also what makes it so thread unsafe. Since the other thread isn't the one that processes messages, it needs to wait until the first thread processes the message, And if the first thread somehow fails to process it, or waits from some data elsewhere, or so on, the second thread will block indefinitely.
There may also be other unsafe functions about SendMessage.