libevfibers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
fbr_destructor Struct Reference

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

Detailed Description

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.

See Also
fbr_destructor_func_t
fbr_destructor_add
fbr_destructor_remove

Definition at line 421 of file fiber.h.

Field Documentation

void* fbr_destructor::arg

destructor function argument (optional)

Definition at line 423 of file fiber.h.

fbr_destructor_func_t fbr_destructor::func

destructor function

Definition at line 422 of file fiber.h.


The documentation for this struct was generated from the following file: