static void control_activate_cb (BonoboControl *control, gboolean activate, EYank *yank) { BonoboUIComponent *ui_component; ui_component = bonobo_control_get_ui_component (control); if (yank->shell_view_interface == NULL) { Bonobo_ControlFrame control_frame; CORBA_Environment ev; control_frame = bonobo_control_get_control_frame (control); if (control_frame == NULL) { goto out; } CORBA_exception_init (&ev); yank->shell_view_interface = Bonobo_Unknown_queryInterface (control_frame, "IDL:GNOME/Evolution/ShellView:1.0", &ev); if (BONOBO_EX (&ev)) { g_warning ("Error getting ShellView. %s", CORBA_exception_id (&ev)); yank->shell_view_interface = CORBA_OBJECT_NIL; } CORBA_exception_free (&ev); } out: if (activate) control_activate (control, ui_component, yank); else control_deactivate (control, ui_component, yank); }
void initialize_structs(void) { numthreads=0; if (control_init(&wq.control)) dabort(); queue_init(&wq.work); if (control_init(&cq.control)) { control_destroy(&wq.control); dabort(); } queue_init(&wq.work); control_activate(&wq.control); }
int start_reader() { if(reader_tid) stop_reader(); if(control_activate(&(incoming_messages.control))) { LOGE("%s: cannot activate incoming messages queue", __func__); return -1; } if(pthread_create(&reader_tid, NULL, reader, NULL)) { LOGE("%s: pthread_create: %s", __func__, strerror(errno)); return -1; } return 0; }
/** * @brief start the @reaper thread * @returns 0 on success, -1 on error */ int start_reaper() { if(reaper_tid) return 0; if(control_activate(&(graveyard.control))) { print( ERROR, "cannot activate the graveyard" ); return -1; } if(pthread_create(&(reaper_tid), NULL, &reaper, NULL)) { print( ERROR, "pthread_create: %s", strerror(errno) ); reaper_tid=0; return -1; } return 0; }