+
+ /* set entry status to busy before we release the clock lock */
+ do {
+ status = GET_ENTRY_STATUS (entry);
+
+ /* check for unscheduled */
+ if (G_UNLIKELY (status == GST_CLOCK_UNSCHEDULED)) {
+ /* entry was unscheduled, move to the next one */
+ GST_CAT_DEBUG (GST_CAT_CLOCK, "async entry %p unscheduled", entry);
+ goto next_entry;
+ }
+
+ /* for periodic timers, status can be EARLY from a previous run */
+ if (G_UNLIKELY (status != GST_CLOCK_OK && status != GST_CLOCK_EARLY))
+ GST_CAT_ERROR (GST_CAT_CLOCK, "unexpected status %d for entry %p",
+ status, entry);
+
+ /* mark the entry as busy but watch out for intermediate unscheduled
+ * statuses */
+ } while (G_UNLIKELY (!CAS_ENTRY_STATUS (entry, status, GST_CLOCK_BUSY)));
+