| 64 | } |
| 65 | |
| 66 | ~pipe_example ( |
| 67 | ) |
| 68 | { |
| 69 | // wait for all the messages to be processed |
| 70 | message_pipe.wait_until_empty(); |
| 71 | |
| 72 | // Now disable the message_pipe. Doing this will cause all calls to |
| 73 | // message_pipe.dequeue() to return false so our thread will terminate |
| 74 | message_pipe.disable(); |
| 75 | |
| 76 | // now block until our thread has terminated |
| 77 | wait(); |
| 78 | } |
| 79 | |
| 80 | // Here we declare our pipe object. It will contain our messages. |
| 81 | dlib::pipe<tsu_type> message_pipe; |