[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pecl-dev
Subject:    [PECL-DEV] [PHP-BUG] Bug #74120 [NEW]: SyncEvent fires only when someone is waiting
From:       "amancio at prjc dot com dot br"<pecl-dev () lists ! php ! net>
Date:       2017-02-17 13:58:27
Message-ID: bug-74120 () bugs ! php ! net
[Download RAW message or body]

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


-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic