Logo Search packages:      
Sourcecode: ardour version File versions  Download package

Thread * Glib::Thread::create ( const sigc::slot< void > &  slot,
bool  joinable 
) [static]

Creates a new thread with the priority THREAD_PRIORITY_NORMAL. If joinable is true, you can wait for this thread's termination by calling join(). Otherwise the thread will just disappear, when ready.

The new thread executes the function or method slot points to. You can pass additional arguments using sigc::bind(). If the thread was created successfully, it is returned, otherwise a ThreadError exception is thrown.

slot A slot to execute in the new thread.
joinable Should this thread be joinable?
The new Thread* on success.

Definition at line 78 of file thread.cc.

  // Make a copy of slot on the heap
  sigc::slot_base *const slot_copy = new sigc::slot<void>(slot);

  GError* error = 0;

  GThread *const thread = g_thread_create(
      &call_thread_entry_slot, slot_copy, joinable, &error);

    delete slot_copy;

  return reinterpret_cast<Thread*>(thread);

Generated by  Doxygen 1.6.0   Back to index