HH\Lib\Experimental\File\Handle::lock

Get a shared or exclusive lock on the file

public function lock(
  HH\Lib\Experimental\File\LockType $mode,
): HH\Lib\Experimental\File\Lock;

This will block until it acquires the lock, which may be forever.

This involves a blocking syscall; async code will not execute while waiting for a lock.

Parameters

  • HH\Lib\Experimental\File\LockType $mode

Returns