Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/corelib/thread/qmutexpool.cpp

    r2 r561  
    22**
    33** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
    4 ** Contact: Qt Software Information ([email protected])
     4** All rights reserved.
     5** Contact: Nokia Corporation ([email protected])
    56**
    67** This file is part of the QtCore module of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    23 ** In addition, as a special exception, Nokia gives you certain
    24 ** additional rights. These rights are described in the Nokia Qt LGPL
    25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
    26 ** package.
     24** In addition, as a special exception, Nokia gives you certain additional
     25** rights.  These rights are described in the Nokia Qt LGPL Exception
     26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** contact the sales department at qt-sales@nokia.com.
     36** If you
     37** @nokia.com.
    3838** $QT_END_LICENSE$
    3939**
     
    5050// use QMutexpool::instance() in new clode.
    5151Q_CORE_EXPORT QMutexPool *qt_global_mutexpool = 0;
    52 Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (true))
     52Q_GLOBAL_STATIC_WITH_ARGS(QMutexPool, globalMutexPool, (e))
    5353
    5454/*!
     
    8989
    9090/*!
    91     Constructs  a QMutexPool, reserving space for \a size QMutexes. If
    92     \a recursive is true, all QMutexes in the pool will be recursive
    93     mutexes; otherwise they will all be non-recursive (the default).
     91    Constructs  a QMutexPool, reserving space for \a size QMutexes.
     92   
     93    .
    9494
    9595    The QMutexes are created when needed, and deleted when the
    9696    QMutexPool is destructed.
    9797*/
    98 QMutexPool::QMutexPool(bool recursive, int size)
    99     : mutexes(size), count(size), recurs(recursive)
     98QMutexPool::QMutexPool(e, int size)
     99    : mutexes(size), e)
    100100{
    101     for (int index = 0; index < count; ++index) {
     101    for (int index = 0; index < ; ++index) {
    102102        mutexes[index] = 0;
    103103    }
     
    110110QMutexPool::~QMutexPool()
    111111{
    112     for (int index = 0; index < count; ++index) {
     112    for (int index = 0; index < ; ++index) {
    113113        delete mutexes[index];
    114114        mutexes[index] = 0;
     
    131131{
    132132    Q_ASSERT_X(address != 0, "QMutexPool::get()", "'address' argument cannot be zero");
    133     int index = int((quintptr(address) >> (sizeof(address) >> 1)) % count);
     133    int index = int((quintptr(address) >> (sizeof(address) >> 1)) % );
    134134
    135135    if (!mutexes[index]) {
    136136        // mutex not created, create one
    137         QMutex *newMutex = new QMutex(recurs ? QMutex::Recursive : QMutex::NonRecursive);
     137        QMutex *newMutex = new QMutex(recurse);
    138138        if (!mutexes[index].testAndSetOrdered(0, newMutex))
    139139            delete newMutex;
Note: See TracChangeset for help on using the changeset viewer.