mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
protect from reentry
This commit is contained in:
parent
ab5f99fb20
commit
b71e4e1a35
@ -209,6 +209,25 @@ unregister_window_class() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: P3DWinSplashWindow::button_click_detected
|
||||||
|
// Access: Protected, Virtual
|
||||||
|
// Description: Called when a button click by the user is detected in
|
||||||
|
// set_mouse_data(), this method simply turns around and
|
||||||
|
// notifies the instance. It's a virtual method to give
|
||||||
|
// subclasses a chance to redirect this message to the
|
||||||
|
// main thread or process, as necessary.
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
void P3DWinSplashWindow::
|
||||||
|
button_click_detected() {
|
||||||
|
// Since this message is detected in the sub-thread in the Windows
|
||||||
|
// case, we have to protect ourselves from re-entry by grabbing the
|
||||||
|
// global _api_lock.
|
||||||
|
ACQUIRE_LOCK(_api_lock);
|
||||||
|
P3DSplashWindow::button_click_detected();
|
||||||
|
RELEASE_LOCK(_api_lock);
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: P3DWinSplashWindow::start_thread
|
// Function: P3DWinSplashWindow::start_thread
|
||||||
// Access: Private
|
// Access: Private
|
||||||
|
@ -43,6 +43,9 @@ public:
|
|||||||
static void register_window_class();
|
static void register_window_class();
|
||||||
static void unregister_window_class();
|
static void unregister_window_class();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void button_click_detected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void start_thread();
|
void start_thread();
|
||||||
void stop_thread();
|
void stop_thread();
|
||||||
|
@ -42,6 +42,9 @@ using namespace std;
|
|||||||
extern ostream *nout_stream;
|
extern ostream *nout_stream;
|
||||||
#define nout (*nout_stream)
|
#define nout (*nout_stream)
|
||||||
|
|
||||||
|
// Appears in p3d_plugin.cxx.
|
||||||
|
extern LOCK _api_lock;
|
||||||
|
|
||||||
// A convenience function for formatting a generic P3D_object to an
|
// A convenience function for formatting a generic P3D_object to an
|
||||||
// ostream.
|
// ostream.
|
||||||
inline ostream &
|
inline ostream &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user