upipe/urefcount.h header reference

Upipe thread-safe reference counting More

Header inclusion [link] 

Members [link] 

Type [link] 

Functions [link] 

Description [link] 

Upipe thread-safe reference counting

Members detail [link] 

#define _UPIPE_UREFCOUNT_H_ [link] 

This macro is declared in upipe/urefcount.h source file, line 31.

struct urefcount [link] 

This struct is declared in upipe/urefcount.h source file, line 50.

FieldDescription
uatomic_uint32_t refcount;number of pointers to the parent object
urefcount_cb cb;function called when the refcount goes down to 0

typedef void (*urefcount_cb)(struct urefcount *) [link] 

This typedef is declared in upipe/urefcount.h source file, line 47.

This typedef is a function pointer freeing a structure.

void urefcount_clean(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 136.

This function cleans up the urefcount structure.

Parameter list:

  • refcount: pointer to a urefcount structure

bool urefcount_dead(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 126.

This function checks for no reference.

Parameter list:

  • refcount: pointer to a urefcount structure

The return value is true if there is no reference to the object

void urefcount_init(struct urefcount *refcount, urefcount_cb cb) [link] 

This function is declared in upipe/urefcount.h source file, line 64.

This function initializes a urefcount. It must be executed before any other call to the refcount structure.

Parameter list:

  • refcount: pointer to a urefcount structure
  • cb: function called when the refcount goes down to 0 (may be NULL)

void urefcount_release(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 100.

This function decrements a reference counter, and possibly frees the object if the refcount goes down to 0.

Parameter list:

  • refcount: pointer to a urefcount structure

void urefcount_reset(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 75.

This function resets a urefcount to 1.

Parameter list:

  • refcount: pointer to a urefcount structure

bool urefcount_single(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 115.

This function checks for more than one reference.

Parameter list:

  • refcount: pointer to a urefcount structure

The return value is true if there is only one reference to the object

struct urefcount * urefcount_use(struct urefcount *refcount) [link] 

This function is declared in upipe/urefcount.h source file, line 86.

This function increments a reference counter.

Parameter list:

  • refcount: pointer to a urefcount structure

The return value is same pointer to a urefcount structure, or NULL if refcount is dead

Valid XHTML 1.0 StrictGenerated by cmassiot on Sun Dec 14 18:31:17 2025 using MkDoc