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>

List of all members.

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

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


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

Generated on Mon Oct 26 09:09:50 2009 for Qore Programming Language by  doxygen 1.5.6