librdmacm: fix event reporting when destroying listen
[mirror/winof/.git] / inc / user / comp_channel.h
index f9789d5..9876871 100644 (file)
@@ -33,6 +33,7 @@
 #define COMP_CHANNEL_H\r
 \r
 #include <windows.h>\r
+#include <dlist.h>\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
@@ -41,8 +42,10 @@ extern "C" {
 typedef struct _COMP_ENTRY\r
 {\r
        struct _COMP_ENTRY              *Next;\r
+       DLIST_ENTRY                             MgrEntry;\r
        OVERLAPPED                              Overlap;\r
        struct _COMP_CHANNEL    *Channel;\r
+       LONG volatile                   Busy;\r
 \r
 }      COMP_ENTRY;\r
 \r
@@ -51,6 +54,8 @@ typedef struct _COMP_CHANNEL
        struct _COMP_MANAGER    *Manager;\r
        COMP_ENTRY                              *Head;\r
        COMP_ENTRY                              **TailPtr;\r
+       COMP_ENTRY                              Entry;\r
+       HANDLE                                  Event;\r
        CRITICAL_SECTION                Lock;\r
        DWORD                                   Milliseconds;\r
 \r
@@ -59,8 +64,13 @@ typedef struct _COMP_CHANNEL
 typedef struct _COMP_MANAGER\r
 {\r
        HANDLE                                  CompQueue;\r
+       DLIST_ENTRY                             DoneList;\r
+       COMP_ENTRY                              Entry;\r
+       HANDLE                                  Thread;\r
+       BOOL                                    Run;\r
        HANDLE                                  Event;\r
-       LONG volatile                   Lock;\r
+       LONG volatile                   Busy;\r
+       CRITICAL_SECTION                Lock;\r
 \r
 }      COMP_MANAGER;\r
 \r
@@ -69,15 +79,17 @@ void                CompManagerClose(COMP_MANAGER *pMgr);
 DWORD          CompManagerMonitor(COMP_MANAGER *pMgr, HANDLE hFile, ULONG_PTR Key);\r
 DWORD          CompManagerPoll(COMP_MANAGER *pMgr, DWORD Milliseconds,\r
                                                        COMP_CHANNEL **ppChannel);\r
+void           CompManagerCancel(COMP_MANAGER *pMgr);\r
 \r
-void           CompChannelInit(COMP_MANAGER *pMgr, COMP_CHANNEL *pChannel,\r
+DWORD          CompChannelInit(COMP_MANAGER *pMgr, COMP_CHANNEL *pChannel,\r
                                                        DWORD Milliseconds);\r
 void           CompChannelCleanup(COMP_CHANNEL *pChannel);\r
 DWORD          CompChannelPoll(COMP_CHANNEL *pChannel, COMP_ENTRY **ppEntry);\r
-void           CompChannelRemoveEntry(COMP_CHANNEL *pChannel, COMP_ENTRY *pEntry);\r
+void           CompChannelCancel(COMP_CHANNEL *pChannel);\r
 \r
 void           CompEntryInit(COMP_CHANNEL *pChannel, COMP_ENTRY *pEntry);\r
 DWORD          CompEntryPost(COMP_ENTRY *pEntry);\r
+COMP_ENTRY     *CompEntryCancel(COMP_ENTRY *pEntry);\r
 \r
 #ifdef __cplusplus\r
 }\r