Skip to content

NonThreadSafeValue ​

final class · pocketmine\thread\NonThreadSafeValue · source

Extends pmmp\thread\ThreadSafe

This class automatically serializes values which can't be shared between threads. This class does NOT enable sharing the variable between threads. Each call to deserialize() will return a new copy of the variable.

Methods ​

__construct() ​

php
public function __construct(mixed $variable)

deserialize() ​

php
public function deserialize() : mixed

Returns a deserialized copy of the original variable.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.