Changes in lemon/bits/windows.cc [1053:64260c0f58eb:1131:43a91b33f374] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/windows.cc
r1053 r1131 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-20 095 * Copyright (C) 2003-2010 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 99 99 GetSystemTime(&time); 100 100 char buf1[11], buf2[9], buf3[5]; 101 101 if (GetDateFormat(MY_LOCALE, 0, &time, 102 102 ("ddd MMM dd"), buf1, 11) && 103 103 GetTimeFormat(MY_LOCALE, 0, &time, … … 131 131 #endif 132 132 } 133 134 WinLock::WinLock() { 135 #ifdef WIN32 136 CRITICAL_SECTION *lock = new CRITICAL_SECTION; 137 InitializeCriticalSection(lock); 138 _repr = lock; 139 #endif 140 } 141 142 WinLock::~WinLock() { 143 #ifdef WIN32 144 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 145 DeleteCriticalSection(lock); 146 delete lock; 147 #endif 148 } 149 150 void WinLock::lock() { 151 #ifdef WIN32 152 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 153 EnterCriticalSection(lock); 154 #endif 155 } 156 157 void WinLock::unlock() { 158 #ifdef WIN32 159 CRITICAL_SECTION *lock = static_cast<CRITICAL_SECTION*>(_repr); 160 LeaveCriticalSection(lock); 161 #endif 162 } 133 163 } 134 164 }
Note: See TracChangeset
for help on using the changeset viewer.