void receiver() {
    int n;
    do {
        n = buf.receive();
        std::cout << "received: " << n << std::endl;
    } while (n != -1); // -1 indicates end of buffer
}
Exemple #2
0
void receiver() {
    int n;
    do {
        n = buf.receive();
        {
            boost::mutex::scoped_lock io_lock(io_mutex);
            std::cout << "received: " << n << std::endl;
        }
    } while (n != -1); // -1 indicates end of buffer
}
Exemple #3
0
void receiver() {
    int n;
    do {
        n = buf.receive();
        if(!(n%10000))
        {
            boost::unique_lock<boost::mutex> io_lock(io_mutex);
            std::cout << "received: " << n << std::endl;
        }
    } while (n != -1); // -1 indicates end of buffer
    buf.send(-1);
}