Thread.createFull

This function creates a new thread with the priority priority. If the underlying thread implementation supports it, the thread gets a stack size of stack_size or the default value for the current platform, if stack_size is 0. If joinable is TRUE, you can wait for this threads termination calling g_thread_join(). Otherwise the thread will just disappear when it terminates. If bound is TRUE, this thread will be scheduled in the system scope, otherwise the implementation is free to do scheduling in the process scope. The first variant is more expensive resource-wise, but generally faster. On some systems (e.g. Linux) all threads are bound. The new thread executes the function func with the argument data. If the thread was created successfully, it is returned. error can be NULL to ignore errors, or non-NULL to report errors. The error is set, if and only if the function returns NULL. Note It is not guaranteed that threads with different priorities really behave accordingly. On some systems (e.g. Linux) there are no thread priorities. On other systems (e.g. Solaris) there doesn't seem to be different scheduling for different priorities. All in all try to avoid being dependent on priorities. Use G_THREAD_PRIORITY_NORMAL here as a default. Note Only use g_thread_create_full() if you really can't use g_thread_create() instead. g_thread_create() does not take stack_size, bound, and priority as arguments, as they should only be used in cases in which it is unavoidable.

class Thread
static
createFull

Parameters

func GThreadFunc

a function to execute in the new thread.

data void*

an argument to supply to the new thread.

stackSize gulong

a stack size for the new thread.

joinable int

should this thread be joinable?

bound int

should this thread be bound to a system thread?

priority GThreadPriority

a priority for the thread.

Return Value

Type: Thread

the new GThread on success.

Throws

GException on failure.

Meta