xref: /haiku/src/system/kernel/vm/PageCacheLocker.h (revision a381c8a06378de22ff08adf4282b4e3f7e50d250)
1 /*
2  * Copyright 2007, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef PAGE_CACHE_LOCKER_H
6 #define PAGE_CACHE_LOCKER_H
7 
8 
9 #include <null.h>
10 
11 struct vm_page;
12 
13 
14 class PageCacheLocker {
15 public:
16 	PageCacheLocker(vm_page* page, bool dontWait = true);
17 	~PageCacheLocker();
18 
19 	bool IsLocked() { return fPage != NULL; }
20 
21 	bool Lock(vm_page* page, bool dontWait = true);
22 	void Unlock();
23 
24 private:
25 	bool _IgnorePage(vm_page* page);
26 
27 	vm_page*	fPage;
28 };
29 
30 #endif	// PAGE_CACHE_LOCKER_H
31