Changeset 2164
- Timestamp:
- 6/13/2010 3:58:53 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/eraser/Eraser.Util.Native/OpenHandle.NameResolver.cpp
r1812 r2164 26 26 27 27 namespace { 28 HANDLE NameResolutionThread;29 NameResolutionThreadParams NameResolutionThreadParam;30 31 28 DWORD __stdcall nameResolutionThread(void* data) 32 29 { … … 101 98 handle = CreateThread(NULL, 0, nameResolutionThread, ¶ms, 0, NULL); 102 99 } 103 104 100 } 105 101 106 102 std::wstring ResolveHandleName(HANDLE handle, int pid) 107 103 { 104 static HANDLE thread = NULL; 105 static NameResolutionThreadParams params; 106 108 107 //Start a name resolution thread (in case one entry hangs) 109 if ( NameResolutionThread == NULL)110 CreateNameThread( NameResolutionThread, NameResolutionThreadParam);108 if (thread == NULL) 109 CreateNameThread(thread, params); 111 110 112 111 //Create a duplicate handle … … 123 122 //Send the handle to the secondary thread for name resolution 124 123 NameResult result(localHandle); 125 NameResolutionThreadParam.Input.push_back(&result);126 ReleaseSemaphore( NameResolutionThreadParam.Semaphore, 1, NULL);124 params.Input.push_back(&result); 125 ReleaseSemaphore(params.Semaphore, 1, NULL); 127 126 128 127 //Wait for the result … … 130 129 { 131 130 //The wait failed. Terminate the thread and recreate another. 132 CreateNameThread( NameResolutionThread, NameResolutionThreadParam);131 CreateNameThread(thread, params); 133 132 } 134 133
Note: See TracChangeset
for help on using the changeset viewer.
