Is it possible to use wxMutex->Lock() in an event handler? Since it's the main program thread (gui thread) it can't sleep right?
+1
A:
You certainly can - it's not going to blow up your computer or melt your hard drive or cause demons to fly out of your nostrils if you try.
That said, doing anything on your UI thread that might block is bad, bad, bad, bad, bad.
So while you technically can, you really shouldn't.
Anon.
2010-01-25 01:16:41
Adding why it is bad might be helpful.
Georg Fritzsche
2010-01-25 01:19:00
The UI thread handles all user interaction for your program. If your UI thread is blocked, then the user *cannot* interact with your program - no responding to mouse clicks, no window repainting, *nothing*. Thus, it is critical not to block the UI thread.
Anon.
2010-01-25 01:22:46
You're wrong about the demons part.
teatope2
2010-01-25 04:30:58