Merged silc_1_0_branch to trunk.
[silc.git] / lib / silcutil / win32 / silcwin32schedule.c
index 66b732ab3882f6bb6118517a79223d7086cfef37..383ececa98a37f09f54595899e8d820d7ed2711e 100644 (file)
@@ -4,12 +4,11 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2001 Pekka Riikonen
+  Copyright (C) 2001 - 2005 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2 of the License, or
-  (at your option) any later version.
+  the Free Software Foundation; version 2 of the License.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -53,7 +52,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 +99,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 +138,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 +195,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 +257,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 +267,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)
 {
 
 }