Chromium Code Reviews| Index: sdk/lib/io/file.dart |
| diff --git a/sdk/lib/io/file.dart b/sdk/lib/io/file.dart |
| index 4ac4486f6795ecda472864baa1e090da77d8b8da..92d144f941e48ca2e05e4ad0251c053549d90366 100644 |
| --- a/sdk/lib/io/file.dart |
| +++ b/sdk/lib/io/file.dart |
| @@ -52,7 +52,11 @@ enum FileLock { |
| /// Shared file lock. |
| SHARED, |
| /// Exclusive file lock. |
| - EXCLUSIVE |
| + EXCLUSIVE, |
| + /// Blocking shared file lock. |
| + BLOCKING_SHARED, |
| + /// Blocking exclusive file lock. |
| + BLOCKING_EXCLUSIVE, |
| } |
| /** |
| @@ -735,6 +739,11 @@ abstract class RandomAccessFile { |
| * |
| * To obtain an exclusive lock on a file it must be opened for writing. |
| * |
| + * If [mode] is [FileLock.EXCLUSIVE] or [FileLock.SHARED], an error is |
| + * signaled if the lock cannot be obtained. If [mode] is |
| + * [FileLock.BLOCKING_EXCLUSIVE] or [FileLock.BLOCKING_SHARED], the |
| + * returned [Future] is resolved only when the lock has been obtained. |
| + * |
|
siva
2016/06/13 15:56:08
This operation is not synchronous, should we allow
zra
2016/06/13 16:03:33
This call is implemented as a request sent to the
Søren Gjesse
2016/06/13 16:05:09
The blocking I/O call is dispatched on the "native
|
| * *NOTE* file locking does have slight differences in behavior across |
| * platforms: |
| * |
| @@ -768,6 +777,11 @@ abstract class RandomAccessFile { |
| * |
| * To obtain an exclusive lock on a file it must be opened for writing. |
| * |
| + * If [mode] is [FileLock.EXCLUSIVE] or [FileLock.SHARED], an exception is |
| + * thrown if the lock cannot be obtained. If [mode] is |
| + * [FileLock.BLOCKING_EXCLUSIVE] or [FileLock.BLOCKING_SHARED], the |
| + * call returns only after the lock has been obtained. |
| + * |
| * *NOTE* file locking does have slight differences in behavior across |
| * platforms: |
| * |