MCPcopy Create free account
hub / github.com/WinMerge/winmerge / AsyncTaskThread

Method AsyncTaskThread

Src/Common/MessageBoxDialog.cpp:396–410  ·  view source on GitHub ↗

* Thread for running the asynchronous task. */

Source from the content-addressed store, hash-verified

394 * Thread for running the asynchronous task.
395 */
396UINT CMessageBoxDialog::AsyncTaskThread(LPVOID lpParam)
397{
398 CMessageBoxDialog *pThis = (CMessageBoxDialog *)lpParam;
399 std::shared_ptr<IAsyncTask> task = std::atomic_load(&pThis->m_pAsyncTask);
400 if (task)
401 {
402 HWND hWnd = pThis->m_hWnd;
403 // reset cancel flag then run the task
404 pThis->m_bAsyncTaskCancelFlag = false;
405 String result = task->RunAndGetMessage(pThis->m_bAsyncTaskCancelFlag);
406 if (!result.empty() && ::IsWindow(hWnd))
407 ::PostMessage(hWnd, WM_USER_ASYNCRESULT, reinterpret_cast<WPARAM>(new String(result)), 0);
408 }
409 return 0;
410}
411
412/*
413 * Method for retrieving the former result of the message box from the registry.

Callers

nothing calls this directly

Calls 2

RunAndGetMessageMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected