This repository has been archived by the owner on Dec 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix fault when shutdown called before start on Thread or Worker
- Loading branch information
Showing
4 changed files
with
33 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
Test pthreads Worker::shutdown | ||
--DESCRIPTION-- | ||
This test verifies shutdown of a Worker (or Thread) not yet started doesn't fault | ||
--FILE-- | ||
<?php | ||
$worker = new Worker(); | ||
|
||
$worker->stack(new class extends Threaded { | ||
public function run() { | ||
var_dump($this); | ||
} | ||
}); | ||
|
||
$worker->shutdown(); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Uncaught RuntimeException: Worker has not been started in %s:10 | ||
Stack trace: | ||
#0 %s(10): Worker->shutdown() | ||
#1 {main} | ||
thrown in %s on line 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters