0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LockSequencer.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 3
9  * of the License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
22 #ifndef HYPERSPACE_LOCKSEQUENCER_H
23 #define HYPERSPACE_LOCKSEQUENCER_H
24 
25 #include <string>
26 
27 namespace Hyperspace {
28 
29  /*
30  * Lock sequencer. This object gets created with each lock
31  * acquisition and gets passed to each service that expects
32  * to be protected by the lock. The service will check the
33  * validity of this sequencer with a call to CheckSequencer
34  * and will reject requests if the sequencer is no longer valid.
35  */
36  struct LockSequencer {
38  std::string name;
40  uint32_t mode;
41  /* lock generation number */
42  uint64_t generation;
43  };
44 
47  enum LockMode {
52  };
53 
56  enum LockStatus {
65  };
66 }
67 
68 #endif // HYPERSPACE_LOCKSEQUENCER_H
Lock successfully granted.
Definition: LockSequencer.h:58
Exclusive lock attempt failed because another has it locked.
Definition: LockSequencer.h:60
Lock in shared mode.
Definition: LockSequencer.h:49
LockStatus
Lock status.
Definition: LockSequencer.h:56
Hyperspace definitions
Lock attempt was cancelled.
Definition: LockSequencer.h:64
uint32_t mode
lock mode (LOCK_MODE_SHARED or LOCK_MODE_EXCLUSIVE)
Definition: LockSequencer.h:40
Lock exclusive mode.
Definition: LockSequencer.h:51
LockMode
Lock mode.
Definition: LockSequencer.h:47
std::string name
Pathname of file that is locked.
Definition: LockSequencer.h:38
Lock attempt pending (internal use only)
Definition: LockSequencer.h:62