synchronized(function (int $value) { return $value + 1; }); \printf("Value after modifying in child thread: %s\n", $value); yield new Delayed(500); // Parent process should access parcel during this time. // Unwrapping the parcel now should give value from parent process. \printf("Value in child thread after being modified in main thread: %s\n", yield $parcel->unwrap()); yield $parcel->synchronized(function (int $value) { return $value + 1; }); };