monotone

monotone Mtn Source Tree

Root/botan/mutex.h

1/*************************************************
2* Mutex Header File *
3* (C) 1999-2007 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_MUTEX_H__
7#define BOTAN_MUTEX_H__
8
9#include <botan/exceptn.h>
10
11namespace Botan {
12
13/*************************************************
14* Mutex Base Class *
15*************************************************/
16class Mutex
17 {
18 public:
19 virtual void lock() = 0;
20 virtual void unlock() = 0;
21 virtual ~Mutex() {}
22 };
23
24/*************************************************
25* Mutex Factory *
26*************************************************/
27class Mutex_Factory
28 {
29 public:
30 virtual Mutex* make() = 0;
31 virtual ~Mutex_Factory() {}
32 };
33
34/*************************************************
35* Default Mutex Factory *
36*************************************************/
37class Default_Mutex_Factory : public Mutex_Factory
38 {
39 public:
40 Mutex* make();
41 };
42
43/*************************************************
44* Mutex Holding Class *
45*************************************************/
46class Mutex_Holder
47 {
48 public:
49 Mutex_Holder(Mutex*);
50 ~Mutex_Holder();
51 private:
52 Mutex* mux;
53 };
54
55/*************************************************
56* Named Mutex Holder *
57*************************************************/
58class Named_Mutex_Holder
59 {
60 public:
61 Named_Mutex_Holder(const std::string&);
62 ~Named_Mutex_Holder();
63 private:
64 const std::string mutex_name;
65 };
66
67}
68
69#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status