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); 17 ~PageCacheLocker(); 18 19 bool IsLocked() { return fPage != NULL; } 20 21 bool Lock(vm_page* page); 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