note 118523 added to class.cond
| From: | 312036773 at qq dot com | Date: | Sun, 20 Dec 2015 18:39:26 +0000 |
| Subject: | note 118523 added to class.cond | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204510@lists.php.net to get a copy of this message | ||
public function run(){
Mutex::lock($this->mutex);
if($this->account->getBalance() >= drawCost){
usleep ( 500 );
$this->account->draw(drawCost);
echo \Thread::getCurrentThreadId () . "__get__" . drawCost . ",The current
Balance is:{$this->account->getBalance()}<br/>";
Cond::broadcast($this->cond);
}
else {
echo \Thread::getCurrentThreadId () . "__get fail__,the current Balance
is:{$this->account->getBalance()}<br/>";
//Use Wait Can be not Running......Why ???
Cond::wait($this->cond,$this->mutex);
}
Mutex::unlock($this->mutex);
}
----
Server IP: 72.52.91.14
Probable Submitter: 221.198.60.118
----
Manual Page -- http://php.net/manual/en/class.cond.php
Edit -- https://master.php.net/note/edit/118523
Del: integrated -- https://master.php.net/note/delete/118523/integrated
Del: useless -- https://master.php.net/note/delete/118523/useless
Del: bad code -- https://master.php.net/note/delete/118523/bad+code
Del: spam -- https://master.php.net/note/delete/118523/spam
Del: non-english -- https://master.php.net/note/delete/118523/non-english
Del: in docs -- https://master.php.net/note/delete/118523/in+docs
Del: other reasons-- https://master.php.net/note/delete/118523
Reject -- https://master.php.net/note/reject/118523
Search -- https://master.php.net/manage/user-notes.php