| Index: runtime/bin/file.h
|
| diff --git a/runtime/bin/file.h b/runtime/bin/file.h
|
| index 990b7b220d43a63c3bf84bd8d5a3427a816602dc..7a8107fd91f4f16629aec759ee9ba50e46aa1281 100644
|
| --- a/runtime/bin/file.h
|
| +++ b/runtime/bin/file.h
|
| @@ -69,6 +69,15 @@ class File {
|
| kStatSize = 6
|
| };
|
|
|
| + enum LockType {
|
| + // These match the constants in FileStat in file_impl.dart.
|
| + kLockMin = 0,
|
| + kLockUnlock = 0,
|
| + kLockShared = 1,
|
| + kLockExclusive = 2,
|
| + kLockMax = 2
|
| + };
|
| +
|
| ~File();
|
|
|
| intptr_t GetFD();
|
| @@ -105,6 +114,9 @@ class File {
|
| // Flush contents of file.
|
| bool Flush();
|
|
|
| + // Lock range of a file.
|
| + bool Lock(LockType lock, int64_t start, int64_t end);
|
| +
|
| // Returns whether the file has been closed.
|
| bool IsClosed();
|
|
|
| @@ -168,6 +180,7 @@ class File {
|
| static CObject* TypeRequest(const CObjectArray& request);
|
| static CObject* IdenticalRequest(const CObjectArray& request);
|
| static CObject* StatRequest(const CObjectArray& request);
|
| + static CObject* LockRequest(const CObjectArray& request);
|
|
|
| private:
|
| explicit File(FileHandle* handle) : handle_(handle) { }
|
|
|