Fix namespace

This commit is contained in:
Hyunjin Song
2024-10-03 20:32:55 +09:00
parent 7ce62fe0cb
commit 7782954e6e
4 changed files with 11 additions and 6 deletions

View File

@@ -12,6 +12,9 @@
#pragma once
namespace lmms
{
/// Nifty counter, also known as "Schwarz Counter". Used for ensuring global
/// static object initialization and destruction order.
@@ -58,3 +61,5 @@ private:
thread_local static int s_count;
};
template <void C(), void D()> thread_local int NiftyCounterTL<C, D>::s_count = 0;
} // namespace lmms

View File

@@ -9,7 +9,7 @@
# include "mingw-std-threads/mutex"
#endif
namespace _cdslib
namespace lmms::_cdslib
{
void init();
void deinit();
@@ -18,6 +18,6 @@ namespace _cdslib
static NiftyCounter<init, deinit> _counter;
static thread_local NiftyCounterTL<_cdslib::thread_init, _cdslib::thread_deinit> _thread_counter;
}
} // namespace lmms:_cdslib
#define CDS_THREAD_GUARD() (void)_cdslib::_thread_counter;
#define CDS_THREAD_GUARD() (void)lmms::_cdslib::_thread_counter;