upipe/urefcount.h header reference

Upipe thread-safe reference counting More

Header inclusion  

Members  

Types  

Functions  

Description  

Upipe thread-safe reference counting

Members detail  

#define _UPIPE_UREFCOUNT_H_  

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

struct urefcount  

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

This struct defines an object with reference counting.

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 *)   

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)  

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

This function cleans up the urefcount structure.

Parameters list:

  • refcount: pointer to a urefcount structure

bool urefcount_dead(struct urefcount *refcount)  

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

This function checks for no reference.

Parameters 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)  

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.

Parameters 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)  

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

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

Parameters list:

  • refcount: pointer to a urefcount structure

void urefcount_reset(struct urefcount *refcount)  

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

This function resets a urefcount to 1.

Parameters list:

  • refcount: pointer to a urefcount structure

bool urefcount_single(struct urefcount *refcount)  

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

This function checks for more than one reference.

Parameters 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)  

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

This function increments a reference counter.

Parameters list:

  • refcount: pointer to a urefcount structure

The return value is same pointer to a urefcount structure

Valid XHTML 1.0 StrictGenerated by cmassiot on Thu Nov 6 12:15:46 2014 using MkDoc