Req #70753 [NEW]: Default value of sem_get()'s parameter auto_release
| From: | kakkau at grr dot la | Date: | Tue, 20 Oct 2015 21:59:07 +0000 |
| Subject: | Req #70753 [NEW]: Default value of sem_get()'s parameter auto_release | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-196714@lists.php.net to get a copy of this message | ||
From: kakkau at grr dot la
Operating system:
PHP version: Irrelevant
Package: Semaphore related
Bug Type: Feature/Change Request
Bug description:Default value of sem_get()'s parameter auto_release
Description:
------------
Set the default value for sem_get()'s parameter auto_release to 0 as 1
allows additional acquisition of semaphores when reassigning semaphore
resource identifiers although the semaphore was not released yet.
Test script:
---------------
<?php
class Sem {
private $key = null;
private $res = null;
public function __construct() {
$this->key = ftok(".",".");
$this->set_res();
$this->acquire();
}
public function set_res() {
// 4th parameter auto_released is 1 by default
$this->res = sem_get($this->key, 1, 0600, 1);
}
public function acquire() {
echo "acquired='".sem_acquire($this->res,true)."'\n";
}
}
$s = new Sem();
$s->set_res();
$s->acquire();
// NOTE: it allows additional acquisition for simple resource variables
too
?>
Expected result:
----------------
acquired='1'
acquired=''
Actual result:
--------------
acquired='1'
acquired='1'
--
Edit bug report at https://bugs.php.net/bug.php?id=70753&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=70753&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=70753&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=70753&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=70753&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=70753&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=70753&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=70753&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=70753&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=70753&r=support
Expected behavior: https://bugs.php.net/fix.php?id=70753&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=70753&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=70753&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=70753&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70753&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=70753&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=70753&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=70753&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70753&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=70753&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=70753&r=mysqlcfg