mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2024-11-24 07:26:13 +00:00
36 lines
718 B
Plaintext
36 lines
718 B
Plaintext
<?php
|
|
|
|
namespace pmmp\thread;
|
|
|
|
/**
|
|
* @implements \IteratorAggregate<array-key, mixed>
|
|
*/
|
|
abstract class ThreadSafe implements \IteratorAggregate{
|
|
|
|
/**
|
|
* @template TReturn
|
|
* @param \Closure() : TReturn $function
|
|
* @param mixed ...$args
|
|
* @return TReturn
|
|
*/
|
|
public function synchronized(\Closure $function, mixed ...$args) : mixed{}
|
|
}
|
|
|
|
/**
|
|
* @template TKey of array-key
|
|
* @template TValue
|
|
* @implements \ArrayAccess<TKey, TValue>
|
|
*/
|
|
final class ThreadSafeArray extends ThreadSafe implements \Countable, \ArrayAccess{
|
|
|
|
/**
|
|
* @return TValue|null
|
|
*/
|
|
public function pop() : mixed{}
|
|
|
|
/**
|
|
* @return TValue|null
|
|
*/
|
|
public function shift() : mixed{}
|
|
}
|