Thread.tryNew

glib.thread.Thread tryNew(string name, glib.types.ThreadFunc func)

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.

Parameters

namean (optional) name for the new thread
funca function to execute in the new thread

Returns

the new #GThread, or null if an error occurred

Throws

[ThreadException]