MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ThreadCleanup

Class ThreadCleanup

src/yvalve/utl.cpp:3239–3266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3237namespace {
3238
3239class ThreadCleanup
3240{
3241public:
3242 static void add(FPTR_VOID_PTR cleanup, void* arg);
3243 static void remove(FPTR_VOID_PTR cleanup, void* arg);
3244 static void destructor(void*);
3245
3246 static void assertNoCleanupChain()
3247 {
3248 fb_assert(!chain);
3249 }
3250
3251private:
3252 FPTR_VOID_PTR function;
3253 void* argument;
3254 ThreadCleanup* next;
3255
3256 static ThreadCleanup* chain;
3257 static GlobalPtr<Mutex> cleanupMutex;
3258
3259 ThreadCleanup(FPTR_VOID_PTR cleanup, void* arg, ThreadCleanup* chain)
3260 : function(cleanup), argument(arg), next(chain) { }
3261
3262 static void initThreadCleanup();
3263 static void finiThreadCleanup();
3264
3265 static ThreadCleanup** findCleanup(FPTR_VOID_PTR cleanup, void* arg);
3266};
3267
3268ThreadCleanup* ThreadCleanup::chain = NULL;
3269GlobalPtr<Mutex> ThreadCleanup::cleanupMutex;

Callers 1

addMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected