diff options
Diffstat (limited to 'examples/corelib/threads/doc/src/waitconditions.qdoc')
-rw-r--r-- | examples/corelib/threads/doc/src/waitconditions.qdoc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/corelib/threads/doc/src/waitconditions.qdoc b/examples/corelib/threads/doc/src/waitconditions.qdoc index 90f911aab3..d46442d079 100644 --- a/examples/corelib/threads/doc/src/waitconditions.qdoc +++ b/examples/corelib/threads/doc/src/waitconditions.qdoc @@ -3,13 +3,13 @@ /*! \example threads/waitconditions - \title Wait Conditions Example - \brief Demonstrates multi-thread programming using Qt. + \examplecategory {Data Processing & I/O} + \title Producer and Consumer using Wait Conditions \ingroup qtconcurrent-mtexamples - \brief The Wait Conditions example shows how to use QWaitCondition and - QMutex to control access to a circular buffer shared by a - producer thread and a consumer thread. + \brief The Producer and Consumer using Wait Conditions example shows + how to use QWaitCondition and QMutex to control access to a circular + buffer shared by a producer thread and a consumer thread. The producer writes data to the buffer until it reaches the end of the buffer, at which point it restarts from the beginning, @@ -30,7 +30,7 @@ An alternative to using QWaitCondition and QMutex to solve the producer-consumer problem is to use QSemaphore. This is what the - \l{Semaphores Example} does. + \l{Producer and Consumer using Semaphores} example does. \section1 Global Variables @@ -109,7 +109,7 @@ thread is the only one that can do anything; the consumer is blocked waiting for the \c bufferNotEmpty condition to be signalled (\c numUsedBytes is 0). Once the producer has put one - byte in the buffer, \c numUsedBytes is \c BufferSize - 1 and the + byte in the buffer, \c numUsedBytes is strictly greater than 0, and the \c bufferNotEmpty condition is signalled. At that point, two things can happen: Either the consumer thread takes over and reads that byte, or the producer gets to produce a second byte. |