X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Fbabeltrace%2Fctf-writer%2Fclock.h;h=cb17ca2b0f2e0c529717aa4b4b8f5efa27e56c6d;hb=8c18d80b69a10f94980d33e6f1c1bdb26b447487;hp=507739b01c24c5e1ec9887a99767e1cc33bad74f;hpb=faec0807cd032e833756c134daecb3668a780cf9;p=babeltrace.git diff --git a/include/babeltrace/ctf-writer/clock.h b/include/babeltrace/ctf-writer/clock.h index 507739b0..cb17ca2b 100644 --- a/include/babeltrace/ctf-writer/clock.h +++ b/include/babeltrace/ctf-writer/clock.h @@ -1,3 +1,6 @@ +#ifndef BABELTRACE_CTF_WRITER_CLOCK_H +#define BABELTRACE_CTF_WRITER_CLOCK_H + /* * BabelTrace - CTF Writer: Clock * @@ -28,3 +31,32 @@ */ #include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * bt_ctf_clock_get and bt_ctf_clock_put: increment and decrement the + * refcount of the clock + * + * You may also use bt_ctf_get() and bt_ctf_put() with clock objects. + * + * These functions ensure that the clock won't be destroyed when it + * is in use. The same number of get and put (plus one extra put to + * release the initial reference done at creation) has to be done to + * destroy a clock. + * + * When the clock refcount is decremented to 0 by a bt_ctf_clock_put, + * the clock is freed. + * + * @param clock Clock instance. + */ +extern void bt_ctf_clock_get(struct bt_ctf_clock *clock); +extern void bt_ctf_clock_put(struct bt_ctf_clock *clock); + +#ifdef __cplusplus +} +#endif + +#endif /* BABELTRACE_CTF_WRITER_CLOCK_H */