File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Test that full sync restores properties of already cached object
3
+ --DESCRIPTION--
4
+ pthreads_store_full_sync_local_properties() wasn't recursively syncing properties of objects which were already cached by the owning thread.
5
+ This means that attempts to connect with dead objects would sometimes be made despite full sync taking place.
6
+ This test verifies that the bug is fixed.
7
+ --FILE--
8
+ <?php
9
+
10
+ $ array = new \ThreadedArray ();
11
+
12
+ $ t1 = new class ($ array ) extends \Thread{
13
+ public function __construct (
14
+ private \ThreadedArray $ array
15
+ ){}
16
+
17
+ public function run () : void {
18
+ $ this ->array [] = new \ThreadedArray ();
19
+ }
20
+ };
21
+ $ t1 ->start () && $ t1 ->join ();
22
+
23
+ var_dump ($ array );
24
+ ?>
25
+ --EXPECT--
26
+ object(ThreadedArray)#1 (1) {
27
+ [0]=>
28
+ object(ThreadedArray)#3 (0) {
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments