Skip to content

Commit 7e19727

Browse files
committed
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.
1 parent 5a83bfb commit 7e19727

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/standard/tests/misc/time_sleep_until_basic.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ Michele Orselli [email protected]
3232
--EXPECT--
3333
bool(true)
3434
bool(true)
35+
--XFAIL--
36+
gettimeofday cannot be used to reliably implement high precision process synchronization

0 commit comments

Comments
 (0)