summaryrefslogtreecommitdiffstats
path: root/sync/syncable/scoped_kernel_lock.h
blob: affc375ab811c7498dc93294e0fa786c36e5bb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// 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.

#ifndef SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_
#define SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_

#include "base/basictypes.h"
#include "base/synchronization/lock.h"

namespace syncer {
namespace syncable {

class Directory;

class ScopedKernelLock {
 public:
  explicit ScopedKernelLock(const Directory* dir);
  ~ScopedKernelLock();

  base::AutoLock scoped_lock_;
  Directory* const dir_;
  DISALLOW_COPY_AND_ASSIGN(ScopedKernelLock);
};

}  // namespace syncable
}  // namespace syncer

#endif  // SYNC_SYNCABLE_SCOPED_KERNEL_LOCK_H_