Logo Search packages:      
Sourcecode: ardour version File versions

Glib::Thread Class Reference

#include <thread.h>

List of all members.

Detailed Description

Represents a running thread. An instance of this class can only be obtained with create(), self(), or wrap(GThread*). It's not possible to delete a Thread object. If the thread is not joinable, its resources will be freed automatically when it exits. Otherwise, if the thread is joinable, you must call join() to avoid a memory leak.

g_thread_exit() is not wrapped, because that function exits a thread without any cleanup. That's especially dangerous in C++ code, since the destructors of automatic objects won't be invoked. Instead, you can throw a Thread::Exit exception, which will be caught by the internal thread entry function.

You might have noticed that the thread entry slot doesn't have the usual void* return value. If you want to return any data from your thread you can pass an additional output argument to the thread's entry slot.

Definition at line 204 of file thread.h.

Public Member Functions

ThreadPriority get_priority () const
const GThread * gobj () const
GThread * gobj ()
void join ()
bool joinable () const
void set_priority (ThreadPriority priority)

Static Public Member Functions

static Threadcreate (const sigc::slot< void > &slot, unsigned long stack_size, bool joinable, bool bound, ThreadPriority priority)
static Threadcreate (const sigc::slot< void > &slot, bool joinable)
static Threadself ()
static void yield ()

Private Member Functions

void operator delete (void *, size_t)
Threadoperator= (const Thread &)
 Thread (const Thread &)

Private Attributes

GThread gobject_

Related Functions

(Note that these are not member functions.)

Threadwrap (GThread *gobject)


class  Exit

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index