diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2015-05-20 10:56:09 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2015-05-20 10:56:09 -0400 |
commit | 107b9bcb70e785c2d12515e38b8b296eea7ab8d8 (patch) | |
tree | 6631d2278f7d036e30c309285fd9e201c41f4e9b /indra/llcommon/llcleanup.h | |
parent | fde0868231a25b8c9ce03a86cb53f1738d35688d (diff) |
MAINT-5232: Introduce SUBSYSTEM_CLEANUP() macro
and use it for existing LLSomeClass::cleanupClass() calls.
This logs the fact of making the call, as well as making it.
Diffstat (limited to 'indra/llcommon/llcleanup.h')
-rw-r--r-- | indra/llcommon/llcleanup.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/llcommon/llcleanup.h b/indra/llcommon/llcleanup.h new file mode 100644 index 0000000000..8eda9a7fb3 --- /dev/null +++ b/indra/llcommon/llcleanup.h @@ -0,0 +1,30 @@ +/** + * @file llcleanup.h + * @author Nat Goodspeed + * @date 2015-05-20 + * @brief Mechanism for cleaning up subsystem resources + * + * $LicenseInfo:firstyear=2015&license=viewerlgpl$ + * Copyright (c) 2015, Linden Research, Inc. + * $/LicenseInfo$ + */ + +#if ! defined(LL_LLCLEANUP_H) +#define LL_LLCLEANUP_H + +#include "llerror.h" + +// Instead of directly calling SomeClass::cleanupClass(), use +// SUBSYSTEM_CLEANUP(SomeClass); +// This logs the call as well as performing it. That gives us a baseline +// subsystem shutdown order against which to compare subsequent dynamic +// shutdown schemes. +#define SUBSYSTEM_CLEANUP(CLASSNAME) \ + do { \ + LL_INFOS("Cleanup") << "Calling " #CLASSNAME "::cleanupClass()" << LL_ENDL; \ + CLASSNAME::cleanupClass(); \ + } while (0) +// Use ancient do { ... } while (0) macro trick to permit a block of +// statements with the same syntax as a single statement. + +#endif /* ! defined(LL_LLCLEANUP_H) */ |