background

background

Types and Values

Description

Functions

bg_set_spare_its ()

void
bg_set_spare_its (ITSignaler *its);

This function requests that the "background" handle the caching or the destruction of its . It is intended to be called only from within the itsignaler_unref() method when the reference count is 0, but right before destroying it.

The caller (the ITSIgnaler's code) must first set the reference count to 1 (and not destroy the object).

Parameters

its

a ITSignaler

 

bg_get_spare_its ()

ITSignaler *
bg_get_spare_its (void);

Requests the "background" thread to provide a ITSignaler which it has kept as a cache (see bg_set_spare_its()). The return value may be NULL (if no ITSignaler object is available), or a pointer to a ITSignaler which refcount is 1.

Returns

a ITSignaler, or NULL.

[transfer full]


bg_set_spare_gda_worker ()

void
bg_set_spare_gda_worker (GdaWorker *worker);

This function requests that the "background" handle the caching or the destruction of worker . It is intended to be called only from within the gda_worker_unref() method when the reference count is 0, but right before destroying it.

The caller (the GdaWorker's code) must first set the reference count to 1 (and not destroy the object).

Parameters

worker

a GdaWorker

 

bg_get_spare_gda_worker ()

GdaWorker *
bg_get_spare_gda_worker (void);

Requests the "background" thread to provide a GdaWorker which it has kept as a cache (see bg_set_spare_gda_worker()). The return value may be NULL (if no GdaWorker object is available), or a pointer to a GdaWorker which refcount is 1 and which has a worker thread available immediately (no job pending or in process).

Returns

a GdaWorker, or NULL.

[transfer full]


bg_join_thread ()

void
bg_join_thread ();

This function must be called by a thread right before it exits, it tells the "background" thread that it can call g_thread_join() without having the risk of blocking. It is called by worker threads right before they exit.


bg_update_stats ()

void
bg_update_stats (BackgroundStats type);

Types and Values

enum BackgroundStats

Members

BG_STATS_MIN

   

BG_CREATED_WORKER

   

BG_DESTROYED_WORKER

   

BG_CACHED_WORKER_REQUESTS

   

BG_REUSED_WORKER_FROM_CACHE

   

BG_STARTED_THREADS

   

BG_JOINED_THREADS

   

BG_CREATED_ITS

   

BG_DESTROYED_ITS

   

BG_CACHED_ITS_REQUESTS

   

BG_REUSED_ITS_FROM_CACHE

   

BG_STATS_MAX