From 97a9a2cc74dd1d54055966bb85f2eb417e16dd1d Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 4 Dec 2015 19:22:29 +0100 Subject: [PATCH] tests/pthreads_001: don't test pthread ext internals --- tests/pthreads_001.phpt | 38 ++++---------------------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/tests/pthreads_001.phpt b/tests/pthreads_001.phpt index b177fbf..3f64cc6 100644 --- a/tests/pthreads_001.phpt +++ b/tests/pthreads_001.phpt @@ -12,28 +12,12 @@ if(!class_exists('Thread')) { class Workhorse extends Thread { - protected $val; - - public function __construct($val) - { - $this->val = $val; - } - public function run() { $v8 = new V8Js(); - $v8->val = $this->val; - $v8->sync_var_dump = function($value) { - $this->synchronized(function($thread) use ($value) { - while(!$thread->readyToPrint) { - $thread->wait(); - } - var_dump($value); - $thread->notify(); - }, $this); - }; - - $v8->executeString('PHP.sync_var_dump(PHP.val);'); + if($v8->executeString('(11 + 12)') != 23) { + throw new \Exception('fail'); + } } } @@ -43,23 +27,9 @@ $bar = new Workhorse('bar'); $foo->start(); $bar->start(); -$bar->synchronized(function($thread) { - $thread->readyToPrint = true; - $thread->notify(); - $thread->wait(); -}, $bar); - -$foo->synchronized(function($thread) { - $thread->readyToPrint = true; - $thread->notify(); - $thread->wait(); -}, $foo); - $foo->join(); $bar->join(); ?> ===EOF=== --EXPECT-- -string(3) "bar" -string(3) "foo" -===EOF=== \ No newline at end of file +===EOF===