2016-08-22 06:40:48 +02:00
|
|
|
<?php declare(strict_types = 1);
|
2016-08-18 18:04:48 +02:00
|
|
|
|
|
|
|
namespace Amp\Concurrent\Threading\Internal;
|
2015-08-29 08:40:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2016-08-18 18:04:48 +02:00
|
|
|
class Storage extends \Threaded {
|
2015-08-29 08:40:10 +02:00
|
|
|
/**
|
|
|
|
* @var mixed
|
|
|
|
*/
|
|
|
|
private $value;
|
|
|
|
|
2015-09-04 01:11:58 +02:00
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
2016-08-18 18:04:48 +02:00
|
|
|
public function __construct($value) {
|
2015-09-04 01:11:58 +02:00
|
|
|
$this->value = $value;
|
|
|
|
}
|
|
|
|
|
2015-08-29 08:40:10 +02:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2016-08-18 18:04:48 +02:00
|
|
|
public function get() {
|
2015-08-29 08:40:10 +02:00
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
2016-08-18 18:04:48 +02:00
|
|
|
public function set($value) {
|
2015-08-29 08:40:10 +02:00
|
|
|
$this->value = $value;
|
|
|
|
}
|
|
|
|
}
|