WIP: add_sync_containers #1

Draft
tqcq wants to merge 3 commits from feat/add_sync_containers into develop
Showing only changes of commit f8195b2cdd - Show all commits

View File

@ -32,6 +32,7 @@ namespace tile {
namespace {
std::atomic<bool> g_quit_siganl{false};
std::atomic<bool> g_tile_running{false};
void
QuitSignalHandler(int sig)
@ -58,6 +59,11 @@ InstallQuitSignalHandler()
int
Start(int argc, char **argv, std::function<int(int, char **)> cb, bool single_thread, bool enable_crash_catch)
{
{
bool expected = false;
TILE_CHECK(g_tile_running.compare_exchange_strong(expected, true), "tile already running.");
}
if (enable_crash_catch) {
// TODO: Add InstallFailureSignalHandler
// google::InstallFailureSignalHandler();
@ -139,6 +145,7 @@ void
Init(int argc, char **argv, std::function<int(int, char **)> cb)
{
std::unique_lock<std::mutex> _(init_lock);
TILE_CHECK(g_tile_running.load() == false, "tile already running.");
assert(lib_thread && "ReInitialize!!!");
const char *my_argv[1] = {"unknown"};