You're right, INFINITE isn't supported by the timer, so the FFFFFFFE value is fine (what's a millisecond when you've waited that long.)
Please ignore my request to change this. -Fab From: Tzachi Dar [mailto:[email protected]] Sent: Monday, September 20, 2010 3:52 AM To: Fab Tillier; [email protected]; Sean Hefty Subject: RE: patch: [complib] Allow the timer to work with windows 2003 So we are talking about something like: #if WINVER >= 0x600 #define CL_MAX_TIME INFINITE #else #define CL_MAX_TIME 0xFFFFFFFE #endif By the way, there is nothing in the ChangeTimerQueueTimer docs that says that it can really wait for infinite time. Thanks Tzachi From: Fab Tillier [mailto:[email protected]] Sent: Sunday, September 19, 2010 8:24 PM To: Tzachi Dar; [email protected]; Sean Hefty Subject: RE: patch: [complib] Allow the timer to work with windows 2003 Can we make the FFFFFFFE define only happen on Windows Server 2003, and use the INFINITE value for the newer operating systems? From: [email protected] [mailto:[email protected]] On Behalf Of Tzachi Dar Sent: Sunday, September 19, 2010 5:20 AM To: Tzachi Dar; [email protected]; Sean Hefty Subject: Re: [ofw] patch: [complib] Allow the timer to work with windows 2003 Applied on 2934. Thanks Tzachi From: Tzachi Dar Sent: Saturday, September 11, 2010 10:31 PM To: Tzachi Dar; [email protected]; Sean Hefty Cc: Uri Habusha Subject: RE: patch: [complib] Allow the timer to work with windows 2003 From: Tzachi Dar [mailto:[email protected]] Sent: Tuesday, September 07, 2010 7:02 PM To: [email protected]; Sean Hefty Cc: Uri Habusha Subject: patch: [complib] Allow the timer to work with windows 2003 It seems that windows 2003 timer does not work with a period of 0xffffffff. The workaround is to use the constant 0xfffffffe instead. Index: B:/users/tzachid/MLNX_WinOF-2_1_2/core/complib/user/cl_timer.c =================================================================== --- B:/users/tzachid/MLNX_WinOF-2_1_2/core/complib/user/cl_timer.c (revision 6479) +++ B:/users/tzachid/MLNX_WinOF-2_1_2/core/complib/user/cl_timer.c (revision 6480) @@ -34,7 +34,8 @@ #include "complib/cl_timer.h" -#define CL_MAX_TIME 0xFFFFFFFF +// Using FFFFFFFF will not work on windows 2003 +#define CL_MAX_TIME 0xFFFFFFFE /* In order to verify us, you can try running the following program on 2003 and on 2008. Thanks Tzachi and xalex #include <windows.h> #include <stdio.h> HANDLE hTimer = NULL; HANDLE hTimerQueue = NULL; int arg = 123; #define CL_MAX_TIME 0xFFFFFFFE VOID CALLBACK TimerRoutine(PVOID lpParam, BOOLEAN TimerOrWaitFired) { printf("Rescheduling it again\n"); if (!ChangeTimerQueueTimer( hTimerQueue , hTimer, 500, CL_MAX_TIME)) { printf("ChangeTimerQueueTimer failed (%d)\n", GetLastError()); return; } printf("Exiting callback\n"); } int main() { // Create the timer queue. hTimerQueue = CreateTimerQueue(); if (NULL == hTimerQueue) { printf("CreateTimerQueue failed (%d)\n", GetLastError()); return 2; } if (!CreateTimerQueueTimer( &hTimer, hTimerQueue , (WAITORTIMERCALLBACK)TimerRoutine, &arg , CL_MAX_TIME, CL_MAX_TIME , WT_EXECUTEINTIMERTHREAD)) { printf("CreateTimerQueueTimer failed (%d)\n", GetLastError()); return ;//3; } if (!ChangeTimerQueueTimer( hTimerQueue , hTimer, 500, CL_MAX_TIME)) { printf("ChangeTimerQueueTimer failed (%d)\n", GetLastError()); return; } SleepEx (100000,TRUE); printf("After sleep\n"); return 0; }
_______________________________________________ ofw mailing list [email protected] http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
