Commit 7e1f6104 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 213234bf
......@@ -220,6 +220,12 @@ private:
// Use .mmap to map file view into memory.
//
// It is safe to use FileH from multiple threads simultaneously.
enum _FileHState {
_FileHOpening = 0, // FileH open is in progress
_FileHOpened = 1, // FileH is opened and can be used
_FileHClosing = 2, // FileH close is in progress
_FileHClosed = 3, // FileH is closed
};
typedef refptr<struct _FileH> FileH;
struct _FileH : object {
Conn wconn;
......@@ -240,6 +246,7 @@ struct _FileH : object {
vector<Mapping> _mmaps; // []Mapping ↑blk_start mappings of this file
// XXX protect by wconn.mu ?
enum _FileHState _state; // opening/opened/closing/closed
int _nopen; // number of times Conn.open returned this fileh
bool _closed; // y after .close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment