Page MenuHomePhabricator

Confirm flock() works as expected in HHVM
Closed, ResolvedPublic

Description

Aaron is concerned that a subtle difference between the Zend interpreter and HHVM's implementations of flock will prove problematic.

https://github.com/facebook/hhvm/blob/master/hphp/runtime/ext/ext_file.cpp#L353


Version: unspecified
Severity: normal

Details

Reference
bz62854

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:04 AM
bzimport set Reference to bz62854.

After a closer look at the man page and after to talking on HHVM a bit I think it should be fine:

"If a process uses open(2) (or similar) to obtain more than one descriptor for the same file, these descriptors are treated independently by flock(). An attempt to lock the file using one of these file descriptors may be denied by a lock that the calling process has already placed via another descriptor."