Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / rlz / win / lib / lib_mutex.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef RLZ_WIN_LIB_LIB_MUTEX_H_
6 #define RLZ_WIN_LIB_LIB_MUTEX_H_
7
8 #include <windows.h>
9
10 namespace rlz_lib {
11 // Cross-process mutex to guarantee serialization of RLZ key accesses.
12 class LibMutex {
13  public:
14   LibMutex();
15   ~LibMutex();
16
17   bool failed() const { return !acquired_; }
18
19  private:
20   bool acquired_;
21   HANDLE mutex_;
22 };
23
24 }  // namespace rlz_lib
25
26 #endif  // RLZ_WIN_LIB_LIB_MUTEX_H_