anchor.diff:      // other process was able to take the lock and write some bytes.
       iWrote[nextToWrite-1] = nextToWrite;
       nextToWrite++;
  -    await raf.unlock(0, length);
  -    try {
  -      await raf.lock(FileLock.EXCLUSIVE, 0, length);
  -    } catch(e) {
  -      // Check that at some point the non-blocking lock fails.
  -      nonBlockingFailed = true;
  -      await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
  +    // Let the other process get the lock at least once by spinning until the
  +    // non-blocking lock fails.
  +    while (!nonBlockingFailed) {
  +      await raf.unlock(0, length);
  +      try {
  +        await raf.lock(FileLock.EXCLUSIVE, 0, length);
  +      } catch(e) {
  +        // Check that at some point the non-blocking lock fails.
  +        nonBlockingFailed = true;
  +        await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
  +      }
       }
       while (true) {
         p = await raf.position();
  
positive.code:   await raf.setPosition(0);
    await raf.lock(FileLock.BLOCKING_EXCLUSIVE, 0, length);
    Process peer = await runPeer(file.path, length, FileLock.BLOCKING_EXCLUSIVE);
  
    // Wait a bit for the other process to get started. We'll synchronize on
    // the file lock.
    await new Future.delayed(const Duration(seconds: 1));
  
    int nextToWrite = 1;
    int at = 0;
  
negative.code: 
  testLockWholeFile() async {
    const int length = 25;
    Directory directory = await Directory.systemTemp.createTemp('dart_file_lock');
    File file = new File(join(directory.path, "file"));
    await file.writeAsBytes(new List.filled(length, 0));
  