1*83812f67SIngo Weinhold // LazyInitializable.h 2*83812f67SIngo Weinhold 3*83812f67SIngo Weinhold #ifndef USERLAND_FS_LAZY_INITIALIZABLE_H 4*83812f67SIngo Weinhold #define USERLAND_FS_LAZY_INITIALIZABLE_H 5*83812f67SIngo Weinhold 6*83812f67SIngo Weinhold #include <OS.h> 7*83812f67SIngo Weinhold 8*83812f67SIngo Weinhold namespace UserlandFSUtil { 9*83812f67SIngo Weinhold 10*83812f67SIngo Weinhold class LazyInitializable { 11*83812f67SIngo Weinhold public: 12*83812f67SIngo Weinhold LazyInitializable(); 13*83812f67SIngo Weinhold LazyInitializable(bool init); 14*83812f67SIngo Weinhold virtual ~LazyInitializable(); 15*83812f67SIngo Weinhold 16*83812f67SIngo Weinhold status_t Access(); 17*83812f67SIngo Weinhold status_t InitCheck() const; 18*83812f67SIngo Weinhold 19*83812f67SIngo Weinhold protected: 20*83812f67SIngo Weinhold virtual status_t FirstTimeInit() = 0; 21*83812f67SIngo Weinhold 22*83812f67SIngo Weinhold protected: 23*83812f67SIngo Weinhold status_t fInitStatus; 24*83812f67SIngo Weinhold sem_id fInitSemaphore; 25*83812f67SIngo Weinhold }; 26*83812f67SIngo Weinhold 27*83812f67SIngo Weinhold } // namespace UserlandFSUtil 28*83812f67SIngo Weinhold 29*83812f67SIngo Weinhold using UserlandFSUtil::LazyInitializable; 30*83812f67SIngo Weinhold 31*83812f67SIngo Weinhold #endif // USERLAND_FS_LAZY_INITIALIZABLE_H 32