Boost logo

Boost :

Subject: [boost] [boost.thread] Documentation code error
From: Philip Bennefall (philip_at_[hidden])
Date: 2013-03-16 16:45:57


Hello,

In the chapter about synchronization in the boost.thread documentation,
where the hello world example with the bank account is being shown, I see a
small problem in the class:

    int GetBalance() {
        mtx_.lock();
        int b = balance_;
        mtx_.unlock();
        return balance_;
    }

I believe it should be:

    int GetBalance() {
        mtx_.lock();
        int b = balance_;
        mtx_.unlock();
        return b;
    }

Kind regards,

Philip Bennefall


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk