2016-12-29 19:16:04 -06:00
|
|
|
<?php
|
2016-08-18 11:04:48 -05:00
|
|
|
|
2017-11-10 09:59:47 -06:00
|
|
|
namespace Amp\Parallel\Thread\Internal;
|
2015-08-29 01:40:10 -05:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
class Storage extends \Threaded {
|
2016-08-26 10:10:03 -05:00
|
|
|
/** @var mixed */
|
2015-08-29 01:40:10 -05:00
|
|
|
private $value;
|
|
|
|
|
2015-09-03 18:11:58 -05:00
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
public function __construct($value) {
|
2015-09-03 18:11:58 -05:00
|
|
|
$this->value = $value;
|
|
|
|
}
|
|
|
|
|
2015-08-29 01:40:10 -05:00
|
|
|
/**
|
|
|
|
* @return mixed
|
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
public function get() {
|
2015-08-29 01:40:10 -05:00
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param mixed $value
|
|
|
|
*/
|
2016-08-18 11:04:48 -05:00
|
|
|
public function set($value) {
|
2015-08-29 01:40:10 -05:00
|
|
|
$this->value = $value;
|
|
|
|
}
|
|
|
|
}
|