From 2736c3b45f2b48d5dbf20f56dffcffa06c23b6bc Mon Sep 17 00:00:00 2001 From: Thomas Punt Date: Tue, 10 Jan 2017 22:56:01 +0000 Subject: [PATCH] Second iteration on updating pthreads' documentation git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341641 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pthreads/book.xml | 31 +++++++++++++++-------- reference/pthreads/threaded/iswaiting.xml | 8 ++++++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/reference/pthreads/book.xml b/reference/pthreads/book.xml index da9481c296..292dbe94a2 100644 --- a/reference/pthreads/book.xml +++ b/reference/pthreads/book.xml @@ -35,10 +35,10 @@ The Worker class has a persistent state, and will be - available from the call to Worker::start until the - object goes out of scope, or is explicitly shutdown (via - Worker::shutdown). Any context with a reference to - the worker object can stack tasks onto the Worker (via + available from the call to Thread::start (an + inherited method) until the object goes out of scope, or is explicitly + shutdown (via Worker::shutdown). Any context with a + reference to the worker object can stack tasks onto the Worker (via Worker::stack), where these tasks will be executed by the worker in a separate thread. The run method of a worker object will be executed before any objects on the worker's stack, @@ -61,18 +61,27 @@ The Volatile class is new to pthreads v3. It is used - to denote mutable properties of classes. + to denote mutable Threaded properties of + Threaded classes (since these are now immutable by + default). - Synchronization: - All of the objects that pthreads creates have built in synchronization in the ( familiar to java programmers ) form of ::wait and ::notify. - Calling ::wait on an object will cause the context to wait for another context to call ::notify on the same object. - This allows for powerful synchronization between Threaded Objects in PHP. + Synchronization is an important ability when threading. All of the objects + that pthreads creates have built in synchronization in the (which will be + familiar to java programmers) form of + Threaded::wait and + Threaded::notify. Calling + Threaded::wait on an object will cause the context + to wait for another context to call + Threaded::notify on the same object. This mechanism + allows for powerful synchronization between Threaded + objects in PHP. - Any objects that are intended for use in the multi-threaded parts of your application should extend Threaded. - + Any objects that are intended for use in the multi-threaded parts of your + application should extend Threaded. + Method Modifiers: diff --git a/reference/pthreads/threaded/iswaiting.xml b/reference/pthreads/threaded/iswaiting.xml index ab6df55a1e..f3a89461f3 100644 --- a/reference/pthreads/threaded/iswaiting.xml +++ b/reference/pthreads/threaded/iswaiting.xml @@ -7,6 +7,14 @@ State Detection + + + + This method has been removed in pthreads v3. + + + + &reftitle.description;