diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt
index 5da67ce..0e79ca0 100644
--- a/docs/gst/gstreamer-sections.txt
+++ b/docs/gst/gstreamer-sections.txt
@@ -1718,11 +1718,14 @@ gst_poll_fd_ignored
 gst_poll_fd_init
 gst_poll_free
 gst_poll_new
+gst_poll_new_timer
 gst_poll_remove_fd
 gst_poll_restart
 gst_poll_set_controllable
 gst_poll_set_flushing
 gst_poll_wait
+gst_poll_read_control
+gst_poll_write_control
 </SECTION>
 
 <SECTION>
diff --git a/gst/gstclock.c b/gst/gstclock.c
index a795c06..e3b0c8e 100644
--- a/gst/gstclock.c
+++ b/gst/gstclock.c
@@ -166,7 +166,7 @@ gst_clock_entry_new (GstClock * clock, GstClockTime time,
   entry->type = type;
   entry->time = time;
   entry->interval = interval;
-  entry->status = GST_CLOCK_BUSY;
+  entry->status = GST_CLOCK_OK;
   entry->func = NULL;
   entry->user_data = NULL;
 
diff --git a/gst/gstpoll.c b/gst/gstpoll.c
index 6e77c2b..2b8f819 100644
--- a/gst/gstpoll.c
+++ b/gst/gstpoll.c
@@ -91,17 +91,19 @@
 /* FIXME: Shouldn't we check or return the return value
  * of write()?
  */
-#define SEND_COMMAND(set, command)                   \
+#define SEND_COMMAND(set, command, result)           \
 G_STMT_START {                                       \
   unsigned char c = command;                         \
-  ssize_t res;                                       \
-  res = write (set->control_write_fd.fd, &c, 1);     \
-  set->control_pending = TRUE;                       \
+  result = write (set->control_write_fd.fd, &c, 1);  \
+  if (result > 0)                                    \
+    set->control_pending = TRUE;                     \
 } G_STMT_END
 
 #define READ_COMMAND(set, command, res)              \
 G_STMT_START {                                       \
   res = read (set->control_read_fd.fd, &command, 1); \
+  if (res <= 0)                                      \
+    set->control_pending = FALSE;                    \
 } G_STMT_END
 
 #define GST_POLL_CMD_WAKEUP  'W'        /* restart the poll/select call */
@@ -149,9 +151,10 @@ struct _GstPoll
 
   gboolean controllable;
   gboolean new_controllable;
-  gboolean waiting;
+  gint waiting;
   gboolean flushing;
   gboolean control_pending;
+  gboolean timer;
 };
 
 static gint
@@ -498,6 +501,34 @@ not_controllable:
 }
 
 /**
+ * gst_poll_new_timer:
+ *
+ * Create a new poll object that can be used for scheduling cancelable timeouts.
+ * A timeout is performed with gst_poll_wait(). Multiple timeouts can be
+ * performed from different threads. 
+ *
+ * Returns: a new #GstPoll, or %NULL in case of an error. Free with
+ * gst_poll_free().
+ *
+ * Since: 0.10.23
+ */
+GstPoll *
+gst_poll_new_timer (void)
+{
+  GstPoll *poll;
+
+  /* make a new controllable poll set */
+  if (!(poll = gst_poll_new (TRUE)))
+    goto done;
+
+  /* we are a timer */
+  poll->timer = TRUE;
+
+done:
+  return poll;
+}
+
+/**
  * gst_poll_free:
  * @set: a file descriptor set.
  *
@@ -995,7 +1026,6 @@ gst_poll_check_ctrl_commands (GstPoll * set, gint res, gboolean * restarting)
       READ_COMMAND (set, cmd, result);
       if (result <= 0) {
         /* no more commands, quit the loop */
-        set->control_pending = FALSE;
         break;
       }
 
@@ -1042,15 +1072,16 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
 
   g_mutex_lock (set->lock);
 
-  /* we cannot wait from multiple threads */
-  if (G_UNLIKELY (set->waiting))
+  /* we cannot wait from multiple threads unless we are a timer */
+  if (G_UNLIKELY (set->waiting > 0 && !set->timer))
     goto already_waiting;
 
   /* flushing, exit immediatly */
   if (G_UNLIKELY (set->flushing))
     goto flushing;
 
-  set->waiting = TRUE;
+  /* add one more waiter */
+  set->waiting++;
 
   do {
     GstPollMode mode;
@@ -1213,8 +1244,8 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
 
     g_mutex_lock (set->lock);
 
-    /* FIXME, can we only do this check when (res > 0)? */
-    gst_poll_check_ctrl_commands (set, res, &restarting);
+    if (!set->timer)
+      gst_poll_check_ctrl_commands (set, res, &restarting);
 
     /* update the controllable state if needed */
     set->controllable = set->new_controllable;
@@ -1227,7 +1258,7 @@ gst_poll_wait (GstPoll * set, GstClockTime timeout)
     }
   } while (G_UNLIKELY (restarting));
 
-  set->waiting = FALSE;
+  set->waiting--;
 
   g_mutex_unlock (set->lock);
 
@@ -1297,7 +1328,7 @@ gst_poll_set_controllable (GstPoll * set, gboolean controllable)
 
   /* delay the change of the controllable state if we are waiting */
   set->new_controllable = controllable;
-  if (!set->waiting)
+  if (set->waiting == 0)
     set->controllable = controllable;
 
   g_mutex_unlock (set->lock);
@@ -1332,11 +1363,13 @@ gst_poll_restart (GstPoll * set)
 
   g_mutex_lock (set->lock);
 
-  if (set->controllable && set->waiting) {
+  if (set->controllable && set->waiting > 0) {
 #ifndef G_OS_WIN32
+    gint result;
+
     /* if we are waiting, we can send the command, else we do not have to
      * bother, future calls will automatically pick up the new fdset */
-    SEND_COMMAND (set, GST_POLL_CMD_WAKEUP);
+    SEND_COMMAND (set, GST_POLL_CMD_WAKEUP, result);
 #else
     SetEvent (set->wakeup_event);
 #endif
@@ -1367,12 +1400,14 @@ gst_poll_set_flushing (GstPoll * set, gboolean flushing)
   /* update the new state first */
   set->flushing = flushing;
 
-  if (flushing && set->controllable && set->waiting) {
+  if (flushing && set->controllable && set->waiting > 0) {
     /* we are flushing, controllable and waiting, wake up the waiter. When we
      * stop the flushing operation we don't clear the wakeup fd here, this will
      * happen in the _wait() thread. */
 #ifndef G_OS_WIN32
-    SEND_COMMAND (set, GST_POLL_CMD_WAKEUP);
+    gint result;
+
+    SEND_COMMAND (set, GST_POLL_CMD_WAKEUP, result);
 #else
     SetEvent (set->wakeup_event);
 #endif
@@ -1380,3 +1415,80 @@ gst_poll_set_flushing (GstPoll * set, gboolean flushing)
 
   g_mutex_unlock (set->lock);
 }
+
+/**
+ * gst_poll_write_control:
+ * @set: a #GstPoll.
+ *
+ * Write a byte to the control socket of the controllable @set.
+ * This function is mostly usefull for timer #GstPoll objects created with
+ * gst_poll_new_timer(). 
+ *
+ * It will make any current and future gst_poll_wait() function return with
+ * 1, meaning the control socket is set. After an equal amount of calls to
+ * gst_poll_read_control() have been performed, calls to gst_poll_wait() will
+ * block again until their timeout expired.
+ *
+ * Returns: %TRUE on success. %FALSE when @set is not controllable or when the
+ * byte could not be written.
+ *
+ * Since: 0.10.23
+ */
+gboolean
+gst_poll_write_control (GstPoll * set)
+{
+  gboolean res = FALSE;
+
+  g_return_val_if_fail (set != NULL, FALSE);
+
+  g_mutex_lock (set->lock);
+  if (set->controllable) {
+#ifndef G_OS_WIN32
+    gint result;
+
+    SEND_COMMAND (set, GST_POLL_CMD_WAKEUP, result);
+    res = (result > 0);
+#else
+    SetEvent (set->wakeup_event);
+#endif
+  }
+  g_mutex_unlock (set->lock);
+
+  return res;
+}
+
+/**
+ * gst_poll_read_control:
+ * @set: a #GstPoll.
+ *
+ * Read a byte from the control socket of the controllable @set.
+ * This function is mostly usefull for timer #GstPoll objects created with
+ * gst_poll_new_timer(). 
+ *
+ * Returns: %TRUE on success. %FALSE when @set is not controllable or when there
+ * was no byte to read.
+ *
+ * Since: 0.10.23
+ */
+gboolean
+gst_poll_read_control (GstPoll * set)
+{
+  gboolean res = FALSE;
+
+  g_return_val_if_fail (set != NULL, FALSE);
+
+  g_mutex_lock (set->lock);
+  if (set->controllable) {
+#ifndef G_OS_WIN32
+    guchar cmd;
+    gint result;
+    READ_COMMAND (set, cmd, result);
+    res = (result > 0);
+#else
+    ResetEvent (set->wakeup_event);
+#endif
+  }
+  g_mutex_unlock (set->lock);
+
+  return res;
+}
diff --git a/gst/gstpoll.h b/gst/gstpoll.h
index 78a9f39..5503fbe 100644
--- a/gst/gstpoll.h
+++ b/gst/gstpoll.h
@@ -64,6 +64,7 @@ typedef struct {
 #define GST_POLL_FD_INIT  { -1, -1 }
 
 GstPoll*        gst_poll_new              (gboolean controllable);
+GstPoll*        gst_poll_new_timer        (void);
 void            gst_poll_free             (GstPoll *set);
 
 void            gst_poll_fd_init          (GstPollFD *fd);
@@ -86,6 +87,9 @@ gboolean        gst_poll_set_controllable (GstPoll *set, gboolean controllable);
 void            gst_poll_restart          (GstPoll *set);
 void            gst_poll_set_flushing     (GstPoll *set, gboolean flushing);
 
+gboolean        gst_poll_write_control    (GstPoll *set);
+gboolean        gst_poll_read_control     (GstPoll *set);
+
 G_END_DECLS
 
 #endif /* __GST_POLL_H__ */
diff --git a/gst/gstsystemclock.c b/gst/gstsystemclock.c
index ee7b889..51acb42 100644
--- a/gst/gstsystemclock.c
+++ b/gst/gstsystemclock.c
@@ -39,6 +39,18 @@
  */
 
 #include "gst_private.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef G_OS_WIN32
+#include <winsock2.h>
+#define EINPROGRESS WSAEINPROGRESS
+#else
+#include <sys/socket.h>
+#endif
+
+#include <gst/gstpoll.h>
 #include "gstinfo.h"
 
 #include "gstsystemclock.h"
@@ -46,12 +58,36 @@
 /* Define this to get some extra debug about jitter from each clock_wait */
 #undef WAIT_DEBUGGING
 
+#define GST_TYPE_CLOCK_TYPE (gst_clock_type_get_type())
+
+struct _GstSystemClockPrivate
+{
+  GstClockType clock_type;
+  GstPoll *timer;
+  gint async_wakeup_count;
+};
+
+#define GST_SYSTEM_CLOCK_GET_PRIVATE(obj)  \
+   (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_SYSTEM_CLOCK, \
+        GstSystemClockPrivate))
+
+enum
+{
+  PROP_0,
+  PROP_CLOCK_TYPE,
+  /* FILL ME */
+};
+
 /* the one instance of the systemclock */
 static GstClock *_the_system_clock = NULL;
 
 static void gst_system_clock_class_init (GstSystemClockClass * klass);
 static void gst_system_clock_init (GstSystemClock * clock);
 static void gst_system_clock_dispose (GObject * object);
+static void gst_system_clock_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec);
+static void gst_system_clock_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec);
 
 static GstClockTime gst_system_clock_get_internal_time (GstClock * clock);
 static guint64 gst_system_clock_get_resolution (GstClock * clock);
@@ -98,6 +134,22 @@ gst_system_clock_get_type (void)
   return clock_type;
 }
 
+static GType
+gst_clock_type_get_type (void)
+{
+  static GType clock_type_type = 0;
+  static const GEnumValue clock_types[] = {
+    {GST_CLOCK_TYPE_REALTIME, "GST_CLOCK_TYPE_REALTIME", "realtime"},
+    {GST_CLOCK_TYPE_MONOTONIC, "GST_CLOCK_TYPE_MONOTONIC", "monotonic"},
+    {0, NULL, NULL},
+  };
+
+  if (G_UNLIKELY (!clock_type_type)) {
+    clock_type_type = g_enum_register_static ("GstClockType", clock_types);
+  }
+  return clock_type_type;
+}
+
 static void
 gst_system_clock_class_init (GstSystemClockClass * klass)
 {
@@ -111,7 +163,16 @@ gst_system_clock_class_init (GstSystemClockClass * klass)
 
   parent_class = g_type_class_peek_parent (klass);
 
+  g_type_class_add_private (klass, sizeof (GstSystemClockPrivate));
+
   gobject_class->dispose = gst_system_clock_dispose;
+  gobject_class->set_property = gst_system_clock_set_property;
+  gobject_class->get_property = gst_system_clock_get_property;
+
+  g_object_class_install_property (gobject_class, PROP_CLOCK_TYPE,
+      g_param_spec_enum ("clock-type", "Clock type",
+          "The type of underlying clock implementation used",
+          GST_TYPE_CLOCK_TYPE, GST_CLOCK_TYPE_REALTIME, G_PARAM_READWRITE));
 
   gstclock_class->get_internal_time = gst_system_clock_get_internal_time;
   gstclock_class->get_resolution = gst_system_clock_get_resolution;
@@ -129,11 +190,16 @@ gst_system_clock_init (GstSystemClock * clock)
       GST_CLOCK_FLAG_CAN_DO_PERIODIC_SYNC |
       GST_CLOCK_FLAG_CAN_DO_PERIODIC_ASYNC);
 
+  clock->priv = GST_SYSTEM_CLOCK_GET_PRIVATE (clock);
+
+  clock->priv->clock_type = GST_CLOCK_TYPE_REALTIME;
+  clock->priv->timer = gst_poll_new_timer ();
+
 #if 0
   /* Uncomment this to start the async clock thread straight away */
-  GST_CLOCK_LOCK (clock);
+  GST_OBJECT_LOCK (clock);
   gst_system_clock_start_async (clock);
-  GST_CLOCK_UNLOCK (clock);
+  GST_OBJECT_UNLOCK (clock);
 #endif
 }
 
@@ -165,6 +231,8 @@ gst_system_clock_dispose (GObject * object)
   sysclock->thread = NULL;
   GST_CAT_DEBUG (GST_CAT_CLOCK, "joined thread");
 
+  gst_poll_free (GST_SYSTEM_CLOCK (clock)->priv->timer);
+
   G_OBJECT_CLASS (parent_class)->dispose (object);
 
   if (_the_system_clock == clock) {
@@ -173,6 +241,40 @@ gst_system_clock_dispose (GObject * object)
   }
 }
 
+static void
+gst_system_clock_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec)
+{
+  GstSystemClock *sysclock = GST_SYSTEM_CLOCK (object);
+
+  switch (prop_id) {
+    case PROP_CLOCK_TYPE:
+      sysclock->priv->clock_type = g_value_get_enum (value);
+      GST_CAT_DEBUG (GST_CAT_CLOCK, "clock-type set to %d",
+          sysclock->priv->clock_type);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static void
+gst_system_clock_get_property (GObject * object, guint prop_id, GValue * value,
+    GParamSpec * pspec)
+{
+  GstSystemClock *sysclock = GST_SYSTEM_CLOCK (object);
+
+  switch (prop_id) {
+    case PROP_CLOCK_TYPE:
+      g_value_set_enum (value, sysclock->priv->clock_type);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
 /**
  * gst_system_clock_obtain:
  *
@@ -214,6 +316,30 @@ gst_system_clock_obtain (void)
   return clock;
 }
 
+static void
+gst_system_clock_clear_async_wakeups_unlocked (GstClock * clock)
+{
+
+  while (GST_SYSTEM_CLOCK (clock)->priv->async_wakeup_count > 0) {
+    GST_CAT_DEBUG (GST_CAT_CLOCK, "reading control");
+    while (!gst_poll_read_control (GST_SYSTEM_CLOCK (clock)->priv->timer)) {
+      g_warning ("gstsystemclock: read control failed, trying again\n");
+    }
+    GST_SYSTEM_CLOCK (clock)->priv->async_wakeup_count--;
+  }
+  GST_CLOCK_BROADCAST (clock);
+}
+
+static void
+gst_system_clock_wakeup_async_unlocked (GstClock * clock)
+{
+  GST_CAT_DEBUG (GST_CAT_CLOCK, "writing control");
+  while (!gst_poll_write_control (GST_SYSTEM_CLOCK (clock)->priv->timer)) {
+    g_warning ("gstsystemclock: write control failed, trying again\n");
+  }
+  GST_SYSTEM_CLOCK (clock)->priv->async_wakeup_count++;
+}
+
 /* this thread reads the sorted clock entries from the queue.
  *
  * It waits on each of them and fires the callback when the timeout occurs.
@@ -285,6 +411,10 @@ gst_system_clock_async_thread (GstClock * clock)
               entry->user_data);
           GST_OBJECT_LOCK (clock);
         }
+        if (clock->entries->data != entry) {
+          /* new entries have been added, clear async wakeups */
+          gst_system_clock_clear_async_wakeups_unlocked (clock);
+        }
         if (entry->type == GST_CLOCK_ENTRY_PERIODIC) {
           /* adjust time now */
           entry->time = requested + entry->interval;
@@ -303,6 +433,8 @@ gst_system_clock_async_thread (GstClock * clock)
          * was canceled. Whatever it is, pick the head entry of the list and
          * continue waiting. */
         GST_CAT_DEBUG (GST_CAT_CLOCK, "async entry %p needs restart", entry);
+        /* clear async wakeups, if any */
+        gst_system_clock_clear_async_wakeups_unlocked (clock);
         continue;
       default:
         GST_CAT_DEBUG (GST_CAT_CLOCK,
@@ -323,21 +455,60 @@ exit:
   GST_CAT_DEBUG (GST_CAT_CLOCK, "exit system clock thread");
 }
 
+#ifdef HAVE_POSIX_TIMERS
+static inline clockid_t
+clock_type_to_posix_id (GstClockType clock_type)
+{
+#ifdef HAVE_MONOTONIC_CLOCK
+  if (clock_type == GST_CLOCK_TYPE_MONOTONIC)
+    return CLOCK_MONOTONIC;
+  else
+#endif
+    return CLOCK_REALTIME;
+}
+#endif
+
 /* MT safe */
 static GstClockTime
 gst_system_clock_get_internal_time (GstClock * clock)
 {
+#ifdef HAVE_POSIX_TIMERS
+  GstSystemClock *sysclock = GST_SYSTEM_CLOCK_CAST (clock);
+  clockid_t ptype;
+  struct timespec ts;
+
+  ptype = clock_type_to_posix_id (sysclock->priv->clock_type);
+
+  if (G_UNLIKELY (clock_gettime (ptype, &ts)))
+    return GST_CLOCK_TIME_NONE;
+
+  return GST_TIMESPEC_TO_TIME (ts);
+#else
   GTimeVal timeval;
 
   g_get_current_time (&timeval);
 
   return GST_TIMEVAL_TO_TIME (timeval);
+#endif
 }
 
 static guint64
 gst_system_clock_get_resolution (GstClock * clock)
 {
+#ifdef HAVE_POSIX_TIMERS
+  GstSystemClock *sysclock = GST_SYSTEM_CLOCK_CAST (clock);
+  clockid_t ptype;
+  struct timespec ts;
+
+  ptype = clock_type_to_posix_id (sysclock->priv->clock_type);
+
+  if (G_UNLIKELY (clock_getres (ptype, &ts)))
+    return GST_CLOCK_TIME_NONE;
+
+  return GST_TIMESPEC_TO_TIME (ts);
+#else
   return 1 * GST_USECOND;
+#endif
 }
 
 /* synchronously wait on the given GstClockEntry.
@@ -360,6 +531,7 @@ static GstClockReturn
 gst_system_clock_id_wait_jitter_unlocked (GstClock * clock,
     GstClockEntry * entry, GstClockTimeDiff * jitter, gboolean restart)
 {
+  GstSystemClock *sysclock = GST_SYSTEM_CLOCK_CAST (clock);
   GstClockTime entryt, real, now, target;
   GstClockTimeDiff diff;
 
@@ -392,49 +564,88 @@ gst_system_clock_id_wait_jitter_unlocked (GstClock * clock,
       GST_TIME_ARGS (entryt), GST_TIME_ARGS (now), GST_TIME_ARGS (real), diff);
 
   if (diff > 0) {
-    GTimeVal tv;
-
 #ifdef WAIT_DEBUGGING
     GstClockTime result, final;
 #endif
 
-    GST_TIME_TO_TIMEVAL (target, tv);
+    while (entry->status != GST_CLOCK_UNSCHEDULED) {
+      gint pollret;
 
-    while (TRUE) {
-      /* now wait on the entry, it either times out or the cond is signaled. */
-      if (!GST_CLOCK_TIMED_WAIT (clock, &tv)) {
-        /* timeout, this is fine, we can report success now */
-        GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked after timeout", entry);
-        entry->status = GST_CLOCK_OK;
+      /* now wait on the entry, it either times out or the fd is written. */
+      entry->status = GST_CLOCK_BUSY;
+      GST_OBJECT_UNLOCK (clock);
+      pollret = gst_poll_wait (sysclock->priv->timer, diff);
+      /* another thread can read the fd before we get the lock */
+      GST_OBJECT_LOCK (clock);
+      if (entry->status == GST_CLOCK_UNSCHEDULED) {
+
+        GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked", entry);
+        while (!gst_poll_read_control (GST_SYSTEM_CLOCK (clock)->priv->timer)) {
+          g_warning ("gstsystemclock: read control failed, trying again\n");
+        }
+        GST_CLOCK_BROADCAST (clock);
+      } else {
+        if (pollret != 0) {
+          /* some other id got unlocked */
+
+          if (!restart) {
+            /* this can happen if the entry got unlocked because of an async
+             * entry was added to the head of the async queue. */
+            GST_CAT_DEBUG (GST_CAT_CLOCK, "wakeup waiting for entry %p", entry);
+            break;
+          }
+
+          /* mark ourselves as EARLY, we release the lock and we could be
+           * unscheduled ourselves but we don't want the unscheduling thread
+           * to write on the fd */
+          entry->status = GST_CLOCK_EARLY;
+
+          /* before waiting on the cond, check if another thread read the fd
+           * before we got the lock */
+          while (gst_poll_wait (sysclock->priv->timer, 0) > 0) {
+            GST_CLOCK_WAIT (clock);
+          }
+
+          if (entry->status == GST_CLOCK_UNSCHEDULED) {
+            break;
+          }
+
+          /* recalc diff for next gst_poll_wait */
+          real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
+          now = gst_clock_adjust_unlocked (clock, real);
+          diff = entryt - now;
+          if (diff <= 0) {
+            entry->status = GST_CLOCK_OK;
+            break;
+          }
+        } else {
+          /* sleep if gst_poll_wait returned early */
+          real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
+          now = gst_clock_adjust_unlocked (clock, real);
+          diff = entryt - now;
+          if (diff > 0) {
+            g_usleep (diff / 1000);
+          }
+
+          /* timeout, this is fine, we can report success now */
+          GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked after timeout",
+              entry);
+          entry->status = GST_CLOCK_OK;
 
 #ifdef WAIT_DEBUGGING
-        real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
-        result = gst_clock_adjust_unlocked (clock, real);
-        final = gst_system_clock_get_internal_time (clock);
-        GST_CAT_DEBUG (GST_CAT_CLOCK, "Waited for %" G_GINT64_FORMAT
-            " got %" G_GINT64_FORMAT " diff %" G_GINT64_FORMAT
-            " %g target-offset %" G_GINT64_FORMAT " %g", entryt, result,
-            result - entryt,
-            (double) (GstClockTimeDiff) (result - entryt) / GST_SECOND,
-            (final - target),
-            ((double) (GstClockTimeDiff) (final - target)) / GST_SECOND);
+          real = GST_CLOCK_GET_CLASS (clock)->get_internal_time (clock);
+          result = gst_clock_adjust_unlocked (clock, real);
+          final = gst_system_clock_get_internal_time (clock);
+          GST_CAT_DEBUG (GST_CAT_CLOCK, "Waited for %" G_GINT64_FORMAT
+              " got %" G_GINT64_FORMAT " diff %" G_GINT64_FORMAT
+              " %g target-offset %" G_GINT64_FORMAT " %g", entryt, result,
+              result - entryt,
+              (double) (GstClockTimeDiff) (result - entryt) / GST_SECOND,
+              (final - target),
+              ((double) (GstClockTimeDiff) (final - target)) / GST_SECOND);
 #endif
-        break;
-      } else {
-        /* the waiting is interrupted because the GCond was signaled. This can
-         * be because this or some other entry was unscheduled. */
-        GST_CAT_DEBUG (GST_CAT_CLOCK, "entry %p unlocked with signal", entry);
-        /* if the entry is unscheduled, we can stop waiting for it, else we
-         * continue our while loop. */
-        if (entry->status == GST_CLOCK_UNSCHEDULED)
           break;
-        /* else restart if we must */
-        if (!restart)
-          break;
-
-        /* this can happen if the entry got unlocked because of an async entry
-         * was added to the head of the async queue. */
-        GST_CAT_DEBUG (GST_CAT_CLOCK, "continue waiting for entry %p", entry);
+        }
       }
     }
   } else if (diff == 0) {
@@ -496,6 +707,8 @@ no_thread:
 static GstClockReturn
 gst_system_clock_id_wait_async (GstClock * clock, GstClockEntry * entry)
 {
+  gboolean empty;
+
   GST_CAT_DEBUG (GST_CAT_CLOCK, "adding async entry %p", entry);
 
   GST_OBJECT_LOCK (clock);
@@ -504,6 +717,8 @@ gst_system_clock_id_wait_async (GstClock * clock, GstClockEntry * entry)
   if (!gst_system_clock_start_async (GST_SYSTEM_CLOCK (clock)))
     goto thread_error;
 
+  empty = (clock->entries == NULL);
+
   /* need to take a ref */
   gst_clock_id_ref ((GstClockID) entry);
   /* insert the entry in sorted order */
@@ -514,13 +729,18 @@ gst_system_clock_id_wait_async (GstClock * clock, GstClockEntry * entry)
    * front, else the thread is just waiting for another entry and
    * will get to this entry automatically. */
   if (clock->entries->data == entry) {
-    GST_CAT_DEBUG (GST_CAT_CLOCK, "async entry added to head, sending signal");
+    GST_CAT_DEBUG (GST_CAT_CLOCK, "async entry added to head");
     /* this will wake up _all_ entries waiting for the clock because we have
      * only one cond for all entries (makes allocation faster). Entries that
      * have not timed out will have their status set to BUSY and should continue
      * to wait. In the case of the async ones, the new head entry should be
      * taken and waited for. */
-    GST_CLOCK_BROADCAST (clock);
+    if (empty) {
+      GST_CAT_DEBUG (GST_CAT_CLOCK, "sending signal");
+      GST_CLOCK_BROADCAST (clock);
+    } else {
+      gst_system_clock_wakeup_async_unlocked (clock);
+    }
   }
   GST_OBJECT_UNLOCK (clock);
 
@@ -543,12 +763,17 @@ gst_system_clock_id_unschedule (GstClock * clock, GstClockEntry * entry)
 {
   GST_CAT_DEBUG (GST_CAT_CLOCK, "unscheduling entry %p", entry);
 
-  GST_OBJECT_LOCK (clock);
   /* mark entry as unscheduled, then wake up all entries. The entries that did
    * not timeout will be woken up but immediatly go to sleep again because their
    * status would still be busy. */
+  GST_OBJECT_LOCK (clock);
+  if (entry->status == GST_CLOCK_BUSY) {
+    GST_CAT_DEBUG (GST_CAT_CLOCK, "writing control");
+    while (!gst_poll_write_control (GST_SYSTEM_CLOCK (clock)->priv->timer)) {
+      g_warning ("gstsystemclock: write control failed, trying again\n");
+    }
+  }
+  /* when it leaves the poll, it'll detect the unscheduled */
   entry->status = GST_CLOCK_UNSCHEDULED;
-  GST_CAT_DEBUG (GST_CAT_CLOCK, "sending signal");
-  GST_CLOCK_BROADCAST (clock);
   GST_OBJECT_UNLOCK (clock);
 }
diff --git a/gst/gstsystemclock.h b/gst/gstsystemclock.h
index b164c72..7e13cfa 100644
--- a/gst/gstsystemclock.h
+++ b/gst/gstsystemclock.h
@@ -31,6 +31,7 @@ G_BEGIN_DECLS
 
 #define GST_TYPE_SYSTEM_CLOCK 			(gst_system_clock_get_type ())
 #define GST_SYSTEM_CLOCK(obj) 			(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SYSTEM_CLOCK, GstSystemClock))
+#define GST_SYSTEM_CLOCK_CAST(obj)		((GstSystemClock *)(obj))
 #define GST_IS_SYSTEM_CLOCK(obj) 		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SYSTEM_CLOCK))
 #define GST_SYSTEM_CLOCK_CLASS(klass) 		(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SYSTEM_CLOCK, GstSystemClockClass))
 #define GST_IS_SYSTEM_CLOCK_CLASS(klass) 	(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SYSTEM_CLOCK))
@@ -39,6 +40,18 @@ G_BEGIN_DECLS
 
 typedef struct _GstSystemClock GstSystemClock;
 typedef struct _GstSystemClockClass GstSystemClockClass;
+typedef struct _GstSystemClockPrivate GstSystemClockPrivate;
+
+/**
+ * GstClockType:
+ * @GST_CLOCK_TYPE_REALTIME: time since Epoch
+ * @GST_CLOCK_TYPE_MONOTONIC: monotonic time since some unspecified starting
+ *                            point
+ */
+typedef enum {
+  GST_CLOCK_TYPE_REALTIME	= 0,
+  GST_CLOCK_TYPE_MONOTONIC	= 1
+} GstClockType;
 
 /**
  * GstSystemClock:
@@ -53,7 +66,10 @@ struct _GstSystemClock {
   GThread	*thread;	/* thread for async notify */
   gboolean 	 stopping;
 
-  gpointer _gst_reserved[GST_PADDING];
+  /* ABI added */
+  GstSystemClockPrivate *priv;
+
+  gpointer _gst_reserved[GST_PADDING - 1];
 };
 
 struct _GstSystemClockClass {
