Bug #74120 [NEW]: SyncEvent fires only when someone is waiting

From: Date: Fri, 17 Feb 2017 13:58:27 +0000
Subject: Bug #74120 [NEW]: SyncEvent fires only when someone is waiting
Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-14515@lists.php.net to get a copy of this message
From: amancio at prjc dot com dot br Operating system: Linux PHP version: 5.6.30 Package: PECL Bug Type: Bug Bug description:SyncEvent fires only when someone is waiting Description: ------------ Using package 'sync' PECL extension; When an instance of SyncEvent calls fire() in a thread, the other instance of SyncEvent just gets fired if it is executing wait(). If the thread is processing other things, the next call to wait() will wait indefinitely. This bad behaviour was observed just on Linux with sync 1.1.0. On Windows, sync 1.1.0 behaves correctly (the next call to wait() knows the event was already fired). Sync 1.0.1 (the previous version) behaves correctly on both platforms, Windows and Linux. Test script: --------------- // a single-threaded example: $event = new SyncEvent("Test-123", true); $event->fire(); if ($event->wait(0)) echo "Fired, ok"; else echo "Not fired?"; Expected result: ---------------- On any platform, any version should have to print "Fired, ok". Actual result: -------------- On Windows, Sync 1.0.1 and 1.1.0 prints "Fired, ok". On Linux, Sync 1.0.1 prints "Fired, ok", but Sync 1.1.0 prints "Not fired?". -- Edit bug report at https://bugs.php.net/bug.php?id=74120&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74120&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74120&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74120&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74120&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74120&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74120&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74120&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74120&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74120&r=support Expected behavior: https://bugs.php.net/fix.php?id=74120&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74120&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74120&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74120&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74120&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74120&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74120&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74120&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74120&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74120&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74120&r=mysqlcfg

« previous php.pecl.dev (#14515) next »