Mercurial > games > semicongine
comparison fuhtark_test/include/winapi/mspthrd.h @ 1500:91c8c3b7cbf0
add: futhark tests for generating vulkan api
| author | sam <sam@basx.dev> |
|---|---|
| date | Wed, 26 Nov 2025 21:36:48 +0700 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1499:1f58458b7ef7 | 1500:91c8c3b7cbf0 |
|---|---|
| 1 #ifndef __MSPTHRD_H | |
| 2 #define __MSPTHRD_H | |
| 3 | |
| 4 typedef enum { | |
| 5 WORK_ITEM,STOP | |
| 6 } COMMAND; | |
| 7 | |
| 8 typedef struct { | |
| 9 COMMAND cmd; | |
| 10 LPTHREAD_START_ROUTINE pfn; | |
| 11 PVOID pContext; | |
| 12 HANDLE hEvent; | |
| 13 } COMMAND_NODE; | |
| 14 | |
| 15 typedef struct { | |
| 16 LIST_ENTRY link; | |
| 17 COMMAND_NODE node; | |
| 18 } COMMAND_QUEUE_ITEM; | |
| 19 | |
| 20 typedef struct _NOTIF_LIST { | |
| 21 CMSPAddress *addr; | |
| 22 _NOTIF_LIST *next; | |
| 23 } NOTIF_LIST,*PNOTIF_LIST; | |
| 24 | |
| 25 class CMSPThread { | |
| 26 public: | |
| 27 CMSPThread() { | |
| 28 InitializeListHead(&m_CommandQueue); | |
| 29 m_hCommandEvent = NULL; | |
| 30 m_hThread = NULL; | |
| 31 m_NotifList = NULL; | |
| 32 m_iStartCount = 0; | |
| 33 } | |
| 34 ~CMSPThread() { }; | |
| 35 HRESULT Start(); | |
| 36 HRESULT Stop(); | |
| 37 HRESULT Shutdown(); | |
| 38 HRESULT ThreadProc(); | |
| 39 static LRESULT CALLBACK NotifWndProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM lParam); | |
| 40 HRESULT RegisterPnpNotification(CMSPAddress *pCMSPAddress); | |
| 41 HRESULT UnregisterPnpNotification(CMSPAddress *pCMSPAddress); | |
| 42 HRESULT QueueWorkItem(LPTHREAD_START_ROUTINE Function,PVOID Context,WINBOOL fSynchronous); | |
| 43 private: | |
| 44 WINBOOL SignalThreadProc() { return SetEvent(m_hCommandEvent); } | |
| 45 CMSPCritSection m_CountLock; | |
| 46 CMSPCritSection m_QueueLock; | |
| 47 int m_iStartCount; | |
| 48 LIST_ENTRY m_CommandQueue; | |
| 49 HANDLE m_hCommandEvent; | |
| 50 HANDLE m_hThread; | |
| 51 HDEVNOTIFY m_hDevNotifyVideo; | |
| 52 HDEVNOTIFY m_hDevNotifyAudio; | |
| 53 HWND m_hWndNotif; | |
| 54 PNOTIF_LIST m_NotifList; | |
| 55 CMSPCritSection m_NotifLock; | |
| 56 }; | |
| 57 | |
| 58 extern CMSPThread g_Thread; | |
| 59 #endif |
