Is wxMessageBox thread safe?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
kylec43
In need of some credit
In need of some credit
Posts: 1
Joined: Fri Jan 31, 2020 2:12 am

Is wxMessageBox thread safe?

Post by kylec43 »

I am trying to call wxMessageBox in a multi-threaded application and it appears to work, but would code like this really be considered thread safe?

Code: Select all

void* wxThread_class::Entry()
{
	main_thread_form->Create_Pop_Up("Message", "Title", wxOK | wxICON_INFORMATION);	//Calls wxMessageBox() in main thread
	return NULL;
}
Thank you!
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Is wxMessageBox thread safe?

Post by catalin »

No.
Direct interaction with the UI is not permitted from secondary threads. There are other mechanisms for this, see https://docs.wxwidgets.org/3.1/overview ... read_notes
Post Reply