blob: 8bbf4ecab528db1bdd979fed1ee6ed0d44698916 (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
// @file pagefault.h
// define this : _PAGEFAULTEXCEPTION
#pragma once
namespace mongo {
class Record;
class PageFaultException /*: public DBException*/ {
unsigned era;
Record *r;
public:
PageFaultException(const PageFaultException& rhs) : era(rhs.era), r(rhs.r) { }
explicit PageFaultException(Record*);
void touch();
};
class PageFaultRetryableSection : boost::noncopyable {
PageFaultRetryableSection *old;
public:
unsigned _laps;
PageFaultRetryableSection();
~PageFaultRetryableSection();
};
#if 0
inline void how_to_use_example() {
// ...
{
PageFaultRetryableSection s;
while( 1 ) {
try {
writelock lk; // or readlock
// do work
break;
}
catch( PageFaultException& e ) {
e.touch();
}
}
}
// ...
}
#endif
}
|