Changeset 561 for trunk/src/corelib/thread/qthread_win.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/corelib/thread/qthread_win.cpp
r2 r561 2 2 ** 3 3 ** 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]) 5 6 ** 6 7 ** This file is part of the QtCore module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 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. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 55 55 #include <private/qeventdispatcher_win_p.h> 56 56 57 #include < windows.h>57 #include <windows.h> 58 58 59 59 … … 113 113 // avoid recursion. 114 114 TlsSetValue(qt_current_thread_data_tls_index, threadData); 115 threadData->thread = new QAdoptedThread(threadData); 115 QT_TRY { 116 threadData->thread = new QAdoptedThread(threadData); 117 } QT_CATCH(...) { 118 TlsSetValue(qt_current_thread_data_tls_index, 0); 119 threadData->deref(); 120 threadData = 0; 121 QT_RETHROW; 122 } 116 123 threadData->deref(); 117 124 } … … 164 171 if (qt_adopted_thread_watcher_handle == 0) { 165 172 if (qt_adopted_thread_wakeup == 0) { 166 qt_adopted_thread_wakeup = QT_WA_INLINE(CreateEventW(0, false, false, 0), 167 CreateEventA(0, false, false, 0)); 173 qt_adopted_thread_wakeup = CreateEvent(0, false, false, 0); 168 174 qt_adopted_thread_handles.prepend(qt_adopted_thread_wakeup); 169 175 } … … 293 299 data->quitNow = false; 294 300 // ### TODO: allow the user to create a custom event dispatcher 295 if (QCoreApplication::instance()) 296 createEventDispatcher(data); 301 createEventDispatcher(data); 297 302 298 303 #if !defined(QT_NO_DEBUG) && defined(Q_CC_MSVC) && !defined(Q_OS_WINCE) … … 366 371 { 367 372 #ifndef Q_OS_WINCE 368 if (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)369 SwitchToThread(); 370 else373 374 #else 375 371 376 #endif 372 ::Sleep(0);373 377 } 374 378 … … 421 425 } 422 426 423 // Since Win 9x will have problems if the priority is idle or time critical424 // we have to use the closest one instead425 427 int prio; 426 428 d->priority = priority; 427 429 switch (d->priority) { 428 430 case IdlePriority: 429 if (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) { 430 prio = THREAD_PRIORITY_LOWEST; 431 } else { 432 prio = THREAD_PRIORITY_IDLE; 433 } 431 prio = THREAD_PRIORITY_IDLE; 434 432 break; 435 433 … … 455 453 456 454 case TimeCriticalPriority: 457 if (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) { 458 prio = THREAD_PRIORITY_HIGHEST; 459 } else { 460 prio = THREAD_PRIORITY_TIME_CRITICAL; 461 } 455 prio = THREAD_PRIORITY_TIME_CRITICAL; 462 456 break; 463 457 … … 565 559 // copied from start() with a few modifications: 566 560 567 // Since Win 9x will have problems if the priority is idle or time critical568 // we have to use the closest one instead569 561 int prio; 570 562 d->priority = priority; 571 563 switch (d->priority) { 572 564 case IdlePriority: 573 if (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) { 574 prio = THREAD_PRIORITY_LOWEST; 575 } else { 576 prio = THREAD_PRIORITY_IDLE; 577 } 565 prio = THREAD_PRIORITY_IDLE; 578 566 break; 579 567 … … 599 587 600 588 case TimeCriticalPriority: 601 if (QSysInfo::WindowsVersion & QSysInfo::WV_DOS_based) { 602 prio = THREAD_PRIORITY_HIGHEST; 603 } else { 604 prio = THREAD_PRIORITY_TIME_CRITICAL; 605 } 589 prio = THREAD_PRIORITY_TIME_CRITICAL; 606 590 break; 607 591
Note:
See TracChangeset
for help on using the changeset viewer.