HomeClusterLabs Projects

Refactor: libcrmcommon: use GSource dispatch return values correctly

Description

Refactor: libcrmcommon: use GSource dispatch return values correctly

crm_trigger_dispatch() is used as the GSource dispatch function for our custom
crm_trigger_t source type. glib will interpret its return value as
G_SOURCE_REMOVE (a.k.a. FALSE) or G_SOURCE_CONTINUE (a.k.a. TRUE).

However our trigger type has its own dispatch function type that uses 0 (a.k.a.
FALSE a.k.a. G_SOURCE_REMOVE) to remove the source, -1 to keep the source and
indicate that the job is still running, and 1 (a.k.a. TRUE a.k.a.
G_SOURCE_CONTINUE) to keep the source and indicate that the job is complete.

Reorganize and document the code to clearly indicate the two different usages.

Details

Provenance
kgaillotAuthored on May 4 2021, 3:45 PM
Parents
rP897df5b54947: Doc: liblrmd: improve comments for lrmd_event_free()
Branches
Unknown
Tags
Unknown

Event Timeline