upipe/urefcount.h header reference
Upipe thread-safe reference counting More
Header inclusion [link]
Members [link]
Type [link]
- typedef void (*urefcount_cb)(struct urefcount *)
Functions [link]
- void urefcount_clean(struct urefcount *refcount)
- bool urefcount_dead(struct urefcount *refcount)
- void urefcount_init(struct urefcount *refcount, urefcount_cb cb)
- void urefcount_release(struct urefcount *refcount)
- void urefcount_reset(struct urefcount *refcount)
- bool urefcount_single(struct urefcount *refcount)
- struct urefcount * urefcount_use(struct urefcount *refcount)
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.
| Field | Description |
|---|---|
| uatomic_uint32_t refcount; | number of pointers to the parent object |
| urefcount_cb cb; | function called when the refcount goes down to 0 |
This typedef is declared in upipe/urefcount.h source file, line 47.
This typedef is a function pointer freeing a structure.
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
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)
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
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
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
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