48 #define TIMESLICE_STACKSIZE 2048
49 #define TIMESLICEMS 10
52 #define DELTA_EPOCH_IN_MICROSECS 11644473600000000ULL
72 FILETIME systemFileTime;
73 FILETIME localFileTime;
77 GetSystemTimeAsFileTime(&systemFileTime);
79 FileTimeToLocalFileTime(&systemFileTime, &localFileTime);
82 sysTimeStamp |= systemFileTime.dwHighDateTime;
84 sysTimeStamp |= systemFileTime.dwLowDateTime;
87 sysTimeStamp = sysTimeStamp / 10UL;
89 localTimeStamp |= localFileTime.dwHighDateTime;
90 localTimeStamp <<= 32;
91 localTimeStamp |= localFileTime.dwLowDateTime;
92 localTimeStamp = localTimeStamp / 10UL;
113 SYSTEMTIME localTime;
116 FileTimeToSystemTime(&localFileTime, &localTime);
118 Date->
hours = localTime.wHour;
119 Date->
minutes = localTime.wMinute;
120 Date->
seconds = localTime.wSecond;
122 Date->
day = localTime.wDay;
123 Date->
month = localTime.wMonth;
124 Date->
year = localTime.wYear;
199 while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) )
202 if ( msg.message == WM_TIMER )
206 TranslateMessage(&msg);
207 DispatchMessage(&msg);
210 if ( WaitForSingleObject(hev, 0) == WAIT_OBJECT_0 )
215 }
while ( MsgWaitForMultipleObjects(1, &hev, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0 + 1 );
238 unsigned int msecInADay = 86400000;
239 HANDLE SemHandle = 0;
240 UINT_PTR TimerHandle = 0;
243 SemHandle = CreateEvent(NULL, TRUE, fState, NULL);
251 context->SetObjectVariable(
"EVENTSEMHANDLE", context->NewPointer(SemHandle));
252 context->SetObjectVariable(
"TIMERSTARTED", context->True());
259 TimerHandle = SetTimer(NULL, 0, msecInADay, NULL);
260 if ( TimerHandle == 0 )
263 CloseHandle(SemHandle);
268 while ( numdays > 0 )
274 RexxObjectPtr cancelObj = context->GetObjectVariable(
"CANCELED");
276 if (cancelObj == context->True())
279 KillTimer(NULL, TimerHandle);
280 CloseHandle(SemHandle);
286 KillTimer(NULL, TimerHandle);
292 TimerHandle = SetTimer(NULL, 0, (UINT)alarmtime, NULL);
296 CloseHandle(SemHandle);
307 KillTimer(NULL, TimerHandle);
310 CloseHandle(SemHandle);
327 if ( ! SetEvent((HANDLE)eventSemHandle) )
static void clearTimeSliceElapsed()
static void setTimeSliceElapsed()
static bool isTerminated()
static void stopTimeSlice()
static void getCurrentTime(RexxDateTime *Date)
static void startTimeSlice()
static void setTimeSliceTimerThread(HANDLE h)
static HANDLE timeSliceTimerThread
#define Rexx_Error_System_service
struct _RexxObjectPtr * RexxObjectPtr
RexxMethod1(int, alarm_stopTimer, POINTER, eventSemHandle)
static void waitTimerOrEvent(HANDLE hev)
#define TIMESLICE_STACKSIZE
RexxMethod2(int, alarm_startTimer, wholenumber_t, numdays, wholenumber_t, alarmtime)
DWORD WINAPI TimeSliceControl(void *args)
unsigned __int64 uint64_t