]> granicus.if.org Git - php/commit
gettimeofday cannot be used to reliably implement high precision process synchronization
authorJoe Watkins <krakjoe@php.net>
Sun, 16 Jun 2019 05:02:28 +0000 (07:02 +0200)
committerJoe Watkins <krakjoe@php.net>
Sun, 16 Jun 2019 05:02:28 +0000 (07:02 +0200)
commit7e1972796b1706a668643830f3e5aa9960a85a70
treecdd04e439bf3ca7caccc2e4e3b521902e29a736c
parent5a83bfb37db63eeba2323392630c26679bc9bab2
gettimeofday cannot be used to reliably implement high precision process synchronization

The use of gettimeofday in time_sleep_until is technically incorrect, it's not possible
to use gettimeofday in this way reliably on any platform: It relies on operating system
global structures, which may be modified by any other process on the system at any time.

While in practice, users may be ignoring this flaw, it entirely depends on the other software
running on the system to which the application is deployed, there is no possible way to write
a test that will always pass on any system, therefore it must be marked XFAIL.
ext/standard/tests/misc/time_sleep_until_basic.phpt