| 45 | static LRESULT CALLBACK fxMessageWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
| 46 | |
| 47 | LRESULT CALLBACK fxMessageWindowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) |
| 48 | { |
| 49 | switch(message) { |
| 50 | case WM_PROMISE: { |
| 51 | txMachine* the = (txMachine*)GetWindowLongPtr(window, 0); |
| 52 | fxRunPromiseJobs(the); |
| 53 | } break; |
| 54 | case WM_SERVICE: { |
| 55 | txMachine* the = (txMachine*)GetWindowLongPtr(window, 0); |
| 56 | (*the->threadCallback)(the->thread); |
| 57 | } break; |
| 58 | case WM_WORKER: { |
| 59 | txMachine* the = (txMachine*)GetWindowLongPtr(window, 0); |
| 60 | txWorkerJob* job; |
| 61 | EnterCriticalSection(&(the->workerMutex)); |
| 62 | job = the->workerQueue; |
| 63 | the->workerQueue = NULL; |
| 64 | LeaveCriticalSection(&(the->workerMutex)); |
| 65 | while (job) { |
| 66 | txWorkerJob* next = job->next; |
| 67 | (*job->callback)(the, job); |
| 68 | c_free(job); |
| 69 | job = next; |
| 70 | } |
| 71 | } break; |
| 72 | #ifdef mxDebug |
| 73 | case WM_XSBUG: { |
| 74 | txMachine* the = (txMachine*)GetWindowLongPtr(window, 0); |
| 75 | if (fxIsReadable(the)) { |
| 76 | fxDebugCommand(the); |
| 77 | if (the->breakOnStartFlag) { |
| 78 | fxBeginHost(the); |
| 79 | fxDebugLoop(the, NULL, 0, "C: xsDebugger"); |
| 80 | fxEndHost(the); |
| 81 | } |
| 82 | } |
| 83 | } break; |
| 84 | #endif |
| 85 | default: |
| 86 | return DefWindowProc(window, message, wParam, lParam); |
| 87 | } |
| 88 | return 0; |
| 89 | } |
| 90 | |
| 91 | void fxCreateMachinePlatform(txMachine* the) |
| 92 | { |
nothing calls this directly
no test coverage detected