Changeset 36218
- Timestamp:
- 12/20/09 23:30:01 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Thread.h
r36216 r36218 130 130 131 131 protected: 132 atomic<HANDLE>hThread;132 HANDLE hThread; 133 133 134 134 public: … … 143 143 DWORD threadId; 144 144 LPVOID obj = reinterpret_cast<LPVOID>(this); 145 HANDLE t= CreateThread(NULL, 0, foo::thread, obj, 0, &threadId);146 if ( t== NULL) {145 hThread = CreateThread(NULL, 0, foo::thread, obj, 0, &threadId); 146 if (hThread == NULL) { 147 147 halt << "CreateThread(): failed"; 148 148 } 149 hThread.store(t);150 149 } 151 150 152 151 void clean() { 153 HANDLE t = hThread.exchange(0); 154 if (!t) { 155 return; 156 } 157 158 CloseHandle(t); 152 if (!hThread) { 153 return; 154 } 155 156 CloseHandle(hThread); 159 157 } 160 158
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)