summaryrefslogtreecommitdiffstats
path: root/rlz/win/lib/lib_mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'rlz/win/lib/lib_mutex.h')
-rw-r--r--rlz/win/lib/lib_mutex.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/rlz/win/lib/lib_mutex.h b/rlz/win/lib/lib_mutex.h
new file mode 100644
index 0000000..6992bea
--- /dev/null
+++ b/rlz/win/lib/lib_mutex.h
@@ -0,0 +1,28 @@
+// Copyright (c) 2012 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.
+//
+// Mutex to guarantee serialization of RLZ key accesses.
+
+#ifndef RLZ_WIN_LIB_LIB_MUTEX_H_
+#define RLZ_WIN_LIB_LIB_MUTEX_H_
+
+#include <windows.h>
+
+namespace rlz_lib {
+
+class LibMutex {
+ public:
+ LibMutex();
+ ~LibMutex();
+
+ bool failed(void) { return !acquired_; }
+
+ private:
+ bool acquired_;
+ HANDLE mutex_;
+};
+
+} // namespace rlz_lib
+
+#endif // RLZ_WIN_LIB_LIB_MUTEX_H_