php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57088 Dispatch should stop looping when no events are left in priority queue
Submitted: 2006-06-14 00:49 UTC Modified: 2013-07-16 06:17 UTC
From: e at osterman dot com Assigned:
Status: Wont fix Package: event (PECL)
PHP Version: 5.1.2 OS: Debian / Redhat
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: e at osterman dot com
New email:
PHP Version: OS:

 

 [2006-06-14 00:49 UTC] e at osterman dot com
Description:
------------
If the priority queue of scheduled events is empty, the dispatch loop should terminate successfully. This bug might be related to the fact that event_have_events returns true even if there are no events. 

Reproduce code:
---------------
<?php

dl('event.so');

event_init();

// called when user hits ^C
function stop($sig) {
    global $s;
    echo "You got signal $sig. Descheduling event.\n";
    event_deschedule($s);
}

$s = event_handle_signal(2, 'stop');

event_schedule($s);

echo "Going into dispatch loop: at t= " . time() . "\n";
event_dispatch();

echo "all done\n";

?>


Expected result:
----------------
all done

program exits.

Actual result:
--------------
program remains stuck in the dispatch loop. "all done" is never reached.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-11 20:08 UTC] e at osterman dot com
Fixed. Here's a patch: http://www.pecl.php.net/bugs/bug.php?id=7892
 [2013-07-16 06:17 UTC] osmanov@php.net
-Status: Open +Status: Wont fix
 [2013-07-16 06:17 UTC] osmanov@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 23:01:27 2024 UTC