php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69984 Worker::unstack() does not unstack
Submitted: 2015-07-02 22:56 UTC Modified: 2017-04-02 15:35 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: derkontrollfreak+9hy5l at gmail dot com Assigned:
Status: Wont fix Package: pthreads (PECL)
PHP Version: 5.6.10 OS: Debian 8.1 amd64
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: derkontrollfreak+9hy5l at gmail dot com
New email:
PHP Version: OS:

 

 [2015-07-02 22:56 UTC] derkontrollfreak+9hy5l at gmail dot com
Description:
------------
My result of Example #1 from http://php.net/manual/en/worker.unstack.php differs from the one in the documentation.

PHP configure line:
./configure --prefix="$HOME/local/php5" \
    --disable-cgi \
    --enable-maintainer-zts \
    --with-libdir=/lib/x86_64-linux-gnu \
    --without-pear \
    --disable-all

pthreads configure line:
./configure --prefix="$HOME/local/php5" \
    --with-php-config="$HOME/local/php5/bin/php-config"

I tested with pthreads 2.0.10 and the current git master 7d4e30a4cf.

Test script:
---------------
<?php
class Work extends Threaded {
    public function run() {
        
    }
}

$my = new Worker();
$work = new Work();
var_dump($my->stack($work));
var_dump($my->unstack($work));
?>

Expected result:
----------------
int(1)
int(0)

Actual result:
--------------
int(1)
int(1)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-02 15:35 UTC] tpunt@php.net
-Status: Open +Status: Wont fix
 [2017-04-02 15:35 UTC] tpunt@php.net
pthreads v2 is no longer supported, and so this issue will not be resolved. The Worker::unstack() method has new semantics in pthreads v3, where it no longer accepts an argument - it just pops the top task from the stack.

Your example code will now produce the following output:

int(1)
object(Work)#2 (0) {
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 04:01:29 2024 UTC