worker_new_unique


Description:


[ Version ( replacement = "Worker.new_unique" ) ]
public Worker worker_new_unique (Worker location, bool allow_destroy)

This function creates a new Worker, or reuses the one at location.

Specifically: <orderedlist> <listitem><para>if *location is null, then a new Worker is created. In this case if allow_destroy is false, then the returned Worker's reference count is 2, thus preventing it form ever being destroyed (unless unref is called somewhere else) </para></listitem> <listitem><para>if *location is not null, the the Worker it points to is returned, its reference count increased by 1</para>< /listitem> </orderedlist>

When the returned Worker's reference count reaches 0, then it is destroyed, and * location is set to null.

In any case, the returned value is the same as *location.

Parameters:

location

a place to store and test for existence, not null

allow_destroy

defines if the created GdaWorker (see case 1 below) will allow its reference to drop to 0 and be destroyed

Returns:

a Worker


Namespace: Gda
Package: libgda-6.0



2022 vala-language.org