Doc: fix invalid usage of doxygen @param command
[platform/upstream/dbus.git] / dbus / dbus-mainloop.c
index e63019f..cef676a 100644 (file)
@@ -74,7 +74,6 @@ struct DBusLoop
 
 typedef struct
 {
-  int refcount;
   DBusTimeout *timeout;
   unsigned long last_tv_sec;
   unsigned long last_tv_usec;
@@ -92,33 +91,15 @@ timeout_callback_new (DBusTimeout         *timeout)
     return NULL;
 
   cb->timeout = timeout;
-  _dbus_get_current_time (&cb->last_tv_sec,
-                          &cb->last_tv_usec);
-  cb->refcount = 1;
-  return cb;
-}
-
-static TimeoutCallback *
-timeout_callback_ref (TimeoutCallback *cb)
-{
-  _dbus_assert (cb->refcount > 0);
-  
-  cb->refcount += 1;
-
+  _dbus_get_monotonic_time (&cb->last_tv_sec,
+                            &cb->last_tv_usec);
   return cb;
 }
 
 static void
-timeout_callback_unref (TimeoutCallback *cb)
+timeout_callback_free (TimeoutCallback *cb)
 {
-  _dbus_assert (cb->refcount > 0);
-
-  cb->refcount -= 1;
-
-  if (cb->refcount == 0)
-    {
-      dbus_free (cb);
-    }
+  dbus_free (cb);
 }
 
 static void
@@ -237,7 +218,6 @@ cull_watches_for_invalid_fd (DBusLoop  *loop,
                              int        fd)
 {
   DBusList *link;
-  DBusList *next;
   DBusList **watches;
 
   _dbus_warn ("invalid request, socket fd %d not open\n", fd);
@@ -278,7 +258,7 @@ refresh_watches_for_fd (DBusLoop  *loop,
 {
   DBusList *link;
   unsigned int flags = 0;
-  dbus_bool_t interested;
+  dbus_bool_t interested = FALSE;
 
   _dbus_assert (fd != -1);
 
@@ -423,7 +403,7 @@ _dbus_loop_add_timeout (DBusLoop           *loop,
     }
   else
     {
-      timeout_callback_unref (tcb);
+      timeout_callback_free (tcb);
       return FALSE;
     }
   
@@ -447,7 +427,7 @@ _dbus_loop_remove_timeout (DBusLoop           *loop,
           _dbus_list_remove_link (&loop->timeouts, link);
           loop->callback_list_serial += 1;
           loop->timeout_count -= 1;
-          timeout_callback_unref (this);
+          timeout_callback_free (this);
 
           return;
         }
@@ -639,7 +619,7 @@ _dbus_loop_iterate (DBusLoop     *loop,
       unsigned long tv_sec;
       unsigned long tv_usec;
       
-      _dbus_get_current_time (&tv_sec, &tv_usec);
+      _dbus_get_monotonic_time (&tv_sec, &tv_usec);
 
       link = _dbus_list_get_first_link (&loop->timeouts);
       while (link != NULL)
@@ -748,7 +728,7 @@ _dbus_loop_iterate (DBusLoop     *loop,
       unsigned long tv_sec;
       unsigned long tv_usec;
 
-      _dbus_get_current_time (&tv_sec, &tv_usec);
+      _dbus_get_monotonic_time (&tv_sec, &tv_usec);
 
       /* It'd be nice to avoid this O(n) thingy here */
       link = _dbus_list_get_first_link (&loop->timeouts);