[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[win-pv-devel] [PATCH 1/6] Rename ThreadEvent and Thread to Monitor[Event|Thread]



From: Owen Smith <owen.smith@xxxxxxxxxx>

Add clarity to the variables used with the MonitorThread

Signed-off-by: Owen Smith <owen.smith@xxxxxxxxxx>
---
 src/monitor/monitor.c | 44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index a8ae21b..a2a3cc1 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -63,8 +63,8 @@ typedef struct _MONITOR_CONTEXT {
     PTCHAR                  DevicePath;
     HDEVNOTIFY              DeviceNotification;
     HANDLE                  Device;
-    HANDLE                  ThreadEvent;
-    HANDLE                  Thread;
+    HANDLE                  MonitorEvent;
+    HANDLE                  MonitorThread;
 } MONITOR_CONTEXT, *PMONITOR_CONTEXT;
 
 MONITOR_CONTEXT MonitorContext;
@@ -402,7 +402,7 @@ again:
     if (!Success)
         goto fail2;
 
-    Handle[0] = Context->ThreadEvent;
+    Handle[0] = Context->MonitorEvent;
     Handle[1] = ProcessInfo.hProcess;
 
     Object = WaitForMultipleObjects(ARRAYSIZE(Handle),
@@ -414,7 +414,7 @@ again:
 
     switch (Object) {
     case WAIT_OBJECT_0:
-        ResetEvent(Context->ThreadEvent);
+        ResetEvent(Context->MonitorEvent);
 
         TerminateProcess(ProcessInfo.hProcess, 1);
         CloseHandle(ProcessInfo.hProcess);
@@ -533,22 +533,22 @@ MonitorAdd(
 
     Context->DevicePath = Path;
 
-    Context->ThreadEvent = CreateEvent(NULL,
-                                       TRUE,
-                                       FALSE,
-                                       NULL);
+    Context->MonitorEvent = CreateEvent(NULL,
+                                        TRUE,
+                                        FALSE,
+                                        NULL);
 
-    if (Context->ThreadEvent == NULL)
+    if (Context->MonitorEvent == NULL)
         goto fail4;
 
-    Context->Thread = CreateThread(NULL,
-                                   0,
-                                   MonitorThread,
-                                   NULL,
-                                   0,
-                                   NULL);
+    Context->MonitorThread = CreateThread(NULL,
+                                          0,
+                                          MonitorThread,
+                                          NULL,
+                                          0,
+                                          NULL);
 
-    if (Context->Thread == INVALID_HANDLE_VALUE)
+    if (Context->MonitorThread == INVALID_HANDLE_VALUE)
         goto fail5;
 
     Log("<====");
@@ -558,8 +558,8 @@ MonitorAdd(
 fail5:
     Log("fail5");
 
-    CloseHandle(Context->ThreadEvent);
-    Context->ThreadEvent = NULL;
+    CloseHandle(Context->MonitorEvent);
+    Context->MonitorEvent = NULL;
 
 fail4:
     Log("fail4");
@@ -604,11 +604,11 @@ MonitorRemove(
 
     Log("====>");
 
-    SetEvent(Context->ThreadEvent);
-    WaitForSingleObject(Context->Thread, INFINITE);
+    SetEvent(Context->MonitorEvent);
+    WaitForSingleObject(Context->MonitorThread, INFINITE);
 
-    CloseHandle(Context->ThreadEvent);
-    Context->ThreadEvent = NULL;
+    CloseHandle(Context->MonitorEvent);
+    Context->MonitorEvent = NULL;
 
     free(Context->DevicePath);
     Context->DevicePath = NULL;
-- 
2.8.3


_______________________________________________
win-pv-devel mailing list
win-pv-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.