mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
This version of pthreads has a substantially improved API, improved performance, improved memory usage, and much less magical and broken behaviour.
33 lines
692 B
Plaintext
33 lines
692 B
Plaintext
<?php
|
|
|
|
/**
|
|
* @implements \IteratorAggregate<array-key, mixed>
|
|
*/
|
|
abstract class ThreadedBase 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 ThreadedArray extends ThreadedBase implements Countable, ArrayAccess{
|
|
|
|
/**
|
|
* @return TValue|null
|
|
*/
|
|
public function pop() : mixed{}
|
|
|
|
/**
|
|
* @return TValue|null
|
|
*/
|
|
public function shift() : mixed{}
|
|
} |