synchronized(function (int $value) { return $value + 1; }); \printf("Value after modifying in child thread: %s\n", $value); delay(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()); $parcel->synchronized(function (int $value) { return $value + 1; }); };