83812f6752
where it will be ported to Haiku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20216 a95241bf-73f2-0310-859d-f6bbb57e9c96
32 lines
588 B
C++
32 lines
588 B
C++
// LazyInitializable.h
|
|
|
|
#ifndef USERLAND_FS_LAZY_INITIALIZABLE_H
|
|
#define USERLAND_FS_LAZY_INITIALIZABLE_H
|
|
|
|
#include <OS.h>
|
|
|
|
namespace UserlandFSUtil {
|
|
|
|
class LazyInitializable {
|
|
public:
|
|
LazyInitializable();
|
|
LazyInitializable(bool init);
|
|
virtual ~LazyInitializable();
|
|
|
|
status_t Access();
|
|
status_t InitCheck() const;
|
|
|
|
protected:
|
|
virtual status_t FirstTimeInit() = 0;
|
|
|
|
protected:
|
|
status_t fInitStatus;
|
|
sem_id fInitSemaphore;
|
|
};
|
|
|
|
} // namespace UserlandFSUtil
|
|
|
|
using UserlandFSUtil::LazyInitializable;
|
|
|
|
#endif // USERLAND_FS_LAZY_INITIALIZABLE_H
|