Thread.tryNew

This function is the same as glib.thread.Thread.new_ except that it allows for the possibility of failure.

If a thread can not be created (due to resource limits), error is set and null is returned.

class Thread
static
tryNew

Parameters

name string

an (optional) name for the new thread

func glib.types.ThreadFunc

a function to execute in the new thread

Return Value

Type: glib.thread.Thread

the new #GThread, or null if an error occurred