| Index: third_party/android_crazy_linker/src/src/crazy_linker_globals.cpp
|
| diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_globals.cpp b/third_party/android_crazy_linker/src/src/crazy_linker_globals.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..26c399c37ff4e1238de13be5e7eb1ce996cf8ba8
|
| --- /dev/null
|
| +++ b/third_party/android_crazy_linker/src/src/crazy_linker_globals.cpp
|
| @@ -0,0 +1,34 @@
|
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "crazy_linker_globals.h"
|
| +
|
| +#include <pthread.h>
|
| +
|
| +#include "crazy_linker_system.h"
|
| +
|
| +namespace crazy {
|
| +
|
| +namespace {
|
| +
|
| +Globals* g_globals = NULL;
|
| +pthread_once_t g_globals_once = PTHREAD_ONCE_INIT;
|
| +
|
| +void CreateGlobalsInstance() { g_globals = new Globals(); }
|
| +
|
| +} // namespace
|
| +
|
| +Globals::Globals() : search_paths_(), rdebug_() {
|
| + pthread_mutex_init(&lock_, NULL);
|
| + search_paths_.ResetFromEnv("LD_LIBRARY_PATH");
|
| +}
|
| +
|
| +Globals::~Globals() { pthread_mutex_destroy(&lock_); }
|
| +
|
| +Globals* Globals::Get() {
|
| + pthread_once(&g_globals_once, CreateGlobalsInstance);
|
| + return g_globals;
|
| +}
|
| +
|
| +} // namespace crazy
|
|
|