gui = 0;
startup_lock = new Condition(1, "BC_DialogThread::startup_lock");
window_lock = new Mutex("BC_DialogThread::window_lock");
+ active_lock = new Mutex("BC_DialogThread::active_lock");
}
BC_DialogThread::~BC_DialogThread()
delete startup_lock;
delete window_lock;
+ delete active_lock;
}
void BC_DialogThread::lock_dialog(const char *location)
void BC_DialogThread::run()
{
+ active_lock->lock("BC_DialogThread::run");
gui = new_gui();
startup_lock->unlock();
int result = gui->run_window();
window_lock->unlock();
handle_close_event(result);
+ active_lock->unlock();
}
BC_Window* BC_DialogThread::new_gui()
join();
}
-
+void BC_DialogThread::join()
+{
+ if( !running() ) return;
+ active_lock->lock("BC_DialogThread::join");
+ active_lock->unlock();
+}