Thread
Object Hierarchy:
Description:
[ Compact ]
public class Thread<T>
The Thread struct represents a running thread.
This struct is returned by g_thread_new
or g_thread_try_new
. You can obtain the Thread
struct representing the current thread by calling self.
GThread is refcounted, see g_thread_ref
and g_thread_unref
. The thread represented by it holds a reference
while it is running, and join consumes the reference that it is given, so it is
normally not necessary to manage GThread references explicitly.
The structure is opaque -- none of its fields may be directly accessed.
Content:
Static methods:
- public static bool supported ()
- public static unowned Thread<T> create<T> (owned ThreadFunc<T> func, bool joinable) throws ThreadError
- public static unowned Thread<T> create_full<T> (owned ThreadFunc<T> func, ulong stack_size, bool joinable, bool bound, ThreadPriority priority) throws ThreadError
- public static unowned Thread<T> self<T> ()
This functions returns the Thread
corresponding to the current thread.
- public static void @yield ()
Causes the calling thread to voluntarily relinquish the CPU, so that
other threads can run.
- public static void exit (T retval)
Terminates the current thread.
- public static void @foreach (Func<Thread> thread_func)
- public static void usleep (ulong microseconds)
Pauses the current thread for the given number of microseconds.
Methods: