Changeset 8 for trunk/src/tools/qcriticalsection_p.cpp
- Timestamp:
- Nov 16, 2005, 8:36:46 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tools/qcriticalsection_p.cpp
r7 r8 36 36 #if defined(QT_THREAD_SUPPORT) 37 37 38 #include "qt_windows.h"39 40 38 #include <private/qcriticalsection_p.h> 41 39 40 #if defined(Q_WS_WIN) 41 # include "qt_windows.h" 42 #elif defined(Q_OS_OS2) 43 # include "qt_os2.h" 44 #endif 45 46 #if defined(Q_WS_WIN) 42 47 class QCriticalSectionPrivate 43 48 { … … 47 52 CRITICAL_SECTION section; 48 53 }; 49 54 #endif 50 55 51 56 QCriticalSection::QCriticalSection() 52 57 { 58 #if defined(Q_WS_WIN) 53 59 d = new QCriticalSectionPrivate; 54 60 InitializeCriticalSection( &d->section ); 61 #endif 55 62 } 56 63 57 64 QCriticalSection::~QCriticalSection() 58 65 { 66 #if defined(Q_WS_WIN) 59 67 DeleteCriticalSection( &d->section ); 60 68 delete d; 69 #endif 61 70 } 62 71 63 72 void QCriticalSection::enter() 64 73 { 74 #if defined(Q_WS_WIN) 65 75 EnterCriticalSection( &d->section ); 76 #elif defined(Q_OS_OS2) 77 DosEnterCritSec(); 78 #endif 66 79 } 67 80 68 81 void QCriticalSection::leave() 69 82 { 83 #if defined(Q_WS_WIN) 70 84 LeaveCriticalSection( &d->section ); 85 #elif defined(Q_OS_OS2) 86 DosExitCritSec(); 87 #endif 71 88 } 72 89
Note:
See TracChangeset
for help on using the changeset viewer.