All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ThreadCleanupList Class Reference

list of functions to be run when a thread ends; required for some external libraries that require explicit cleanup when a thread terminates More...

`#include <qore_thread.h>`

## Public Member Functions

DLLEXPORT void | push (qtdest_t func, void *arg)
| must only be called in the module initialization function
DLLEXPORT void | pop (bool exec=true)
| must only be called in the module destructor/deletion function

## Detailed Description

list of functions to be run when a thread ends; required for some external libraries that require explicit cleanup when a thread terminates

this list is not locked and therefore the ThreadCleanupList::push() and ThreadCleanupList::pop() functions must only be called in module initialization and module deletion. However this list is implemented in such a way that thread cleanup list execution may be safely called interally while push() is being executed in a module initialization function, for example.

Note
  this is a global object and not an attribute of a thread

## Member Function Documentation

DLLEXPORT void ThreadCleanupList::pop | ( | bool | exec = `true` | ) |

must only be called in the module destructor/deletion function

Parameters

  exec | if true the cleanup function will be executed immediately, if false it will not

DLLEXPORT void ThreadCleanupList::push | ( | qtdest_t | func,
|  | void * | arg
| ) |  |

must only be called in the module initialization function

Parameters

  func | the cleanup function to be run whenever a thread ends
  arg | the argument to the function (can be 0)

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

- include/qore/qore_thread.h (5431)