GLib.Threadstruct represents a running thread. This struct is returned by g_thread_new() or g_thread_try_new(). You can obtain the
GLib.Threadstruct representing the current thread by calling
GLib.Threadis refcounted, see
GLib.Thread.unref(). The thread represented by it holds a reference while it is running, and
GLib.Thread.join() consumes the reference that it is given, so it is normally not necessary to manage
The structure is opaque – none of its fields may be directly accessed.
Parameters: retval (
None) – the return value of this thread
Terminates the current thread.
GLib.Thread.exit() with a parameter retval is equivalent to returning retval from the function func, as given to g_thread_new().
You must only call
GLib.Thread.exit() from a thread that you created yourself with g_thread_new() or related APIs. You must not call this function from a thread created with another threading library or or from within a
GLib.Threadrepresenting the current thread
This function returns the
GLib.Threadcorresponding to the current thread. Note that this function does not increase the reference count of the returned struct.
This function will return a
GLib.Threadeven for threads that were not created by GLib (i.e. those created by other threading APIs). This may be useful for thread identification purposes (i.e. comparisons) but you must not use GLib functions (such as
GLib.Thread.join()) on these threads.
Causes the calling thread to voluntarily relinquish the CPU, so that other threads can run.
This function is often used as a method to make busy wait less evil.
Returns: the return value of the thread Return type:
The value returned by func or given to
GLib.Thread.exit() is returned by this function.
GLib.Thread.join() consumes the reference to the passed-in self. This will usually cause the
GLib.Threadstruct and associated resources to be freed. Use
GLib.Thread.ref() to obtain an extra reference if you want to keep the
GLib.Threadalive beyond the
Returns: a new reference to self Return type:
Increase the reference count on self.
New in version 2.32.