+void
+Graph::drop_threads ()
+{
+ _quit_threads = true;
+
+ for (unsigned int i=0; i< _thread_list.size(); i++) {
+ _execution_sem.signal ();
+ }
+
+ _callback_start_sem.signal ();
+
+ for (list<pthread_t>::iterator i = _thread_list.begin(); i != _thread_list.end(); ++i) {
+ void* status;
+ pthread_join (*i, &status);
+ }
+
+ _thread_list.clear ();
+
+ _execution_tokens = 0;
+
+ _quit_threads = false;
+}
+
+void
+Graph::clear_other_chain ()
+{
+ Glib::Threads::Mutex::Lock ls (_swap_mutex);
+
+ while (1) {
+ if (_setup_chain != _pending_chain) {
+
+ for (node_list_t::iterator ni=_nodes_rt[_setup_chain].begin(); ni!=_nodes_rt[_setup_chain].end(); ni++) {
+ (*ni)->_activation_set[_setup_chain].clear();
+ }
+
+ _nodes_rt[_setup_chain].clear ();
+ _init_trigger_list[_setup_chain].clear ();
+ break;
+ }
+ /* setup chain == pending chain - we have
+ to wait till this is no longer true.
+ */
+ _cleanup_cond.wait (_swap_mutex);
+ }
+}
+