[haiku-commits] Re: haiku: hrev50215 - in src: add-ons/media/media-add-ons/mixer servers/media

  • From: marcus overhagen <marcusoverhagen@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 19 Apr 2016 17:42:04 +0200

On Tue, Apr 12, 2016 at 2:34 AM, <b.vitruvio@xxxxxxxxx> wrote:


* The event time is managed through the main node control
loop.
* Make the mix thread to activate only when needed.
* Make the locking more simple and remove a race condition,
this will make the thread to be more silent too.

-               bigtime_t waitUntil = fTimeSource->RealTimeFor(eventTime,
0)
-                       - latency - fDownstreamLatency;
-               Unlock();



-               status_t rv = acquire_sem_etc(fMixThreadWaitSem, 1,
B_ABSOLUTE_TIMEOUT,
-                       waitUntil);
-               if (rv == B_INTERRUPTED)



+               ret = acquire_sem_etc(fMixThreadWaitSem, 1,
+                       B_RELATIVE_TIMEOUT | B_DO_NOT_RESCHEDULE, 100000);
+               if (ret == B_TIMED_OUT)
                        continue;


I don't understand. Previously the wakup time was calculated to wake up
before an event needed to be processed. Now it's basically a for (;;;)
Sleep(100000);

regards
Marcus

Other related posts: