Require pthreads ^5.1

This version of pthreads has a substantially improved API, improved
performance, improved memory usage, and much less magical and broken
behaviour.
This commit is contained in:
Dylan K. Taylor
2023-01-23 20:02:33 +00:00
parent 14b250c63f
commit 222415859a
22 changed files with 245 additions and 118 deletions

View File

@ -1,6 +1,33 @@
<?php
/**
* @implements \Traversable<array-key, mixed>
* @implements \IteratorAggregate<array-key, mixed>
*/
class Threaded implements \Traversable{}
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{}
}