[commit: ghc] master: Use usecs rather than msecs for microseconds (0735831)

Ian Lynagh igloo at earth.li
Wed Feb 6 02:08:25 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/073583173b42c988ef8af7f1a7a5f010645bbaef

>---------------------------------------------------------------

commit 073583173b42c988ef8af7f1a7a5f010645bbaef
Author: Ian Lynagh <ian at well-typed.com>
Date:   Tue Feb 5 23:26:24 2013 +0000

    Use usecs rather than msecs for microseconds
    
    We were using "us" elsewhere, so this was inconsistent.

>---------------------------------------------------------------

 rts/win32/AsyncIO.c   |    6 +++---
 rts/win32/AsyncIO.h   |    2 +-
 rts/win32/IOManager.c |    8 ++++----
 rts/win32/IOManager.h |    4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/rts/win32/AsyncIO.c b/rts/win32/AsyncIO.c
index 979df0c..9f45317 100644
--- a/rts/win32/AsyncIO.c
+++ b/rts/win32/AsyncIO.c
@@ -118,15 +118,15 @@ addIORequest(int   fd,
 }
 
 unsigned int
-addDelayRequest(int msecs)
+addDelayRequest(int usecs)
 {
     EnterCriticalSection(&queue_lock);
     issued_reqs++;
     LeaveCriticalSection(&queue_lock);
 #if 0
-    fprintf(stderr, "addDelayReq: %d\n", msecs); fflush(stderr);
+    fprintf(stderr, "addDelayReq: %d\n", usecs); fflush(stderr);
 #endif
-    return AddDelayRequest(msecs,onIOComplete);
+    return AddDelayRequest(usecs,onIOComplete);
 }
 
 unsigned int
diff --git a/rts/win32/AsyncIO.h b/rts/win32/AsyncIO.h
index 27669ce..8d99c0a 100644
--- a/rts/win32/AsyncIO.h
+++ b/rts/win32/AsyncIO.h
@@ -14,7 +14,7 @@ addIORequest(int   fd,
 	     int   isSock,
 	     int   len,
 	     char* buf);
-extern unsigned int addDelayRequest(int   msecs);
+extern unsigned int addDelayRequest(int   usecs);
 extern unsigned int addDoProcRequest(void* proc, void* param);
 extern int  startupAsyncIO(void);
 extern void shutdownAsyncIO(rtsBool wait_threads);
diff --git a/rts/win32/IOManager.c b/rts/win32/IOManager.c
index 13bdb6f..8490ed2 100644
--- a/rts/win32/IOManager.c
+++ b/rts/win32/IOManager.c
@@ -199,8 +199,8 @@ IOWorkerProc(PVOID param)
 		     * 
 		     * Note: Sleep() is in milliseconds, not micros.
 		     */
-		    Sleep((work->workData.delayData.msecs + 999) / 1000);
-		    len = work->workData.delayData.msecs;
+		    Sleep((work->workData.delayData.usecs + 999) / 1000);
+		    len = work->workData.delayData.usecs;
 		    complData = NULL;
 		    fd = 0;
 		    errCode = 0;
@@ -409,7 +409,7 @@ AddIORequest ( int   fd,
  * the request queue.
  */
 BOOL
-AddDelayRequest ( unsigned int   msecs,
+AddDelayRequest ( unsigned int   usecs,
 		  CompletionProc onCompletion)
 {
     WorkItem* wItem = (WorkItem*)malloc(sizeof(WorkItem));
@@ -418,7 +418,7 @@ AddDelayRequest ( unsigned int   msecs,
   
     /* Fill in the blanks */
     wItem->workKind     = WORKER_DELAY;
-    wItem->workData.delayData.msecs = msecs;
+    wItem->workData.delayData.usecs = usecs;
     wItem->onCompletion = onCompletion;
     wItem->requestID    = reqID;
     wItem->link         = NULL;
diff --git a/rts/win32/IOManager.h b/rts/win32/IOManager.h
index 145a1e5..866e950 100644
--- a/rts/win32/IOManager.h
+++ b/rts/win32/IOManager.h
@@ -48,7 +48,7 @@ typedef union workData {
 	char *buf; 
     } ioData;
     struct { 
-	int   msecs;
+	int   usecs;
     } delayData;
     struct { 
 	DoProcProc proc;
@@ -88,7 +88,7 @@ extern void ShutdownIOManager  ( rtsBool wait_threads );
  * completion routine is supplied, which the worker thread
  * will invoke upon completion.
  */
-extern int AddDelayRequest ( unsigned int   msecs,
+extern int AddDelayRequest ( unsigned int   usecs,
 			     CompletionProc onCompletion);
 
 extern int AddIORequest ( int            fd,





More information about the ghc-commits mailing list