Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

src_corelib_thread_qmutexpool.cpp

//! [0]
00002 class Number {
public:
    Number(double n) : num (n) { }

    void setNumber(double n) { num = n; }
    double number() const { return num; }

private:
    double num;
};
//! [0]


//! [1]
void calcSquare(Number *num)
{
    QMutexLocker locker(mutexpool.get(num));
    num.setNumber(num.number() * num.number());
}
//! [1]

Generated by  Doxygen 1.6.0   Back to index