Merged silc_1_0_branch to trunk.
[silc.git] / lib / silcutil / win32 / silcwin32schedule.c
index 66b732ab3882f6bb6118517a79223d7086cfef37..c3dedee37270ebcd574a59be92023d798fafed3e 100644 (file)
@@ -53,7 +53,8 @@
 int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeout)
 {
   HANDLE handles[MAXIMUM_WAIT_OBJECTS];
-  DWORD ready, curtime, timeo;
+  DWORD ready, curtime;
+  LONG timeo;
   int nhandles = 0, i;
   MSG msg;
 
@@ -99,6 +100,7 @@ int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeou
       KillTimer(NULL, timer);
       if (timeo != INFINITE) {
        timeo -= GetTickCount() - curtime;
+       curtime = GetTickCount();
        if (timeo < 0)
          timeo = 0;
       }
@@ -137,6 +139,7 @@ int silc_select(SilcScheduleFd fds, SilcUInt32 fds_count, struct timeval *timeou
        return and we will give the wait another try. */
     if (timeo != INFINITE) {
       timeo -= GetTickCount() - curtime;
+      curtime = GetTickCount();
       if (timeo < 0)
        timeo = 0;
     }
@@ -193,7 +196,7 @@ SILC_TASK_CALLBACK(silc_schedule_wakeup_cb)
    the scheduler needs to be wakenup when tasks are added or removed from
    the task queues.  Returns context to the platform specific scheduler. */
 
-void *silc_schedule_internal_init(SilcSchedule schedule)
+void *silc_schedule_internal_init(SilcSchedule schedule, void *app_context)
 {
 #ifdef SILC_THREADS
   SilcWin32Wakeup wakeup;
@@ -255,7 +258,9 @@ void silc_schedule_internal_wakeup(void *context)
 /* Register signal */
 
 void silc_schedule_internal_signal_register(void *context,
-                                           SilcUInt32 signal)
+                                            SilcUInt32 signal,
+                                            SilcTaskCallback callback,
+                                            void *callback_context)
 {
 
 }
@@ -263,7 +268,24 @@ void silc_schedule_internal_signal_register(void *context,
 /* Unregister signal */
 
 void silc_schedule_internal_signal_unregister(void *context,
-                                             SilcUInt32 signal)
+                                              SilcUInt32 signal,
+                                              SilcTaskCallback callback,
+                                              void *callback_context)
+{
+
+}
+
+/* Mark signal to be called later. */
+
+void silc_schedule_internal_signal_call(void *context, SilcUInt32 signal)
+{
+
+}
+
+/* Call all signals */
+
+void silc_schedule_internal_signals_call(void *context,
+                                         SilcSchedule schedule)
 {
 
 }