libevfibers
|
Destructor structure. More...
#include <fiber.h>
Public Member Functions | |
TAILQ_ENTRY (fbr_destructor) entries |
Data Fields | |
fbr_destructor_func_t | func |
void * | arg |
int | active |
Destructor structure.
This structure holds information required for destruction. As it's defined in public interface, it may be used as stack-allocatable destructor (it's used internally the same way).
Stack-allocated destructor might be useful if one has some resource (e.g. file descriptor), which needs to be destructed in some way, and it's lifespan continues across several fbr_* calls. While being in some library call, a fiber may be reclaimed, but it's stack remains intact until reclaimed. Destructor is called before the stack becomes dangerous to use and guarantees resource destruction.
User is supposed to fill in the func and arg fields.
void* fbr_destructor::arg |
fbr_destructor_func_t fbr_destructor::func |