Changeset 36218

Show
Ignore:
Timestamp:
12/20/09 23:30:01 (3 years ago)
Author:
saturday06
Message:

asdf

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Thread.h

    r36216 r36218  
    130130 
    131131protected: 
    132     atomic<HANDLE> hThread; 
     132    HANDLE hThread; 
    133133 
    134134public: 
     
    143143        DWORD threadId; 
    144144        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) { 
    147147            halt << "CreateThread(): failed"; 
    148148        } 
    149         hThread.store(t); 
    150149    } 
    151150 
    152151    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); 
    159157    } 
    160158