ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/timer_unix.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/timer_unix.cpp (file contents):
Revision 1.18 by gbeauche, 2005-06-30T10:34:31Z vs.
Revision 1.19 by gbeauche, 2006-05-01T13:13:18Z

# Line 333 | Line 333 | void idle_wait(void)
333          pthread_mutex_unlock(&idle_lock);
334   #else
335   #ifdef IDLE_USES_SEMAPHORE
336 +        LOCK_IDLE;
337          if (idle_sem_ok < 0)
338                  idle_sem_ok = (sem_init(&idle_sem, 0, 0) == 0);
339          if (idle_sem_ok > 0) {
339                LOCK_IDLE;
340                  idle_sem_ok++;
341                  UNLOCK_IDLE;
342                  sem_wait(&idle_sem);
343                  return;
344          }
345 +        UNLOCK_IDLE;
346   #endif
347 +
348 +        // Fallback: sleep 10 ms
349          Delay_usec(10000);
350   #endif
351   }
# Line 358 | Line 361 | void idle_resume(void)
361          pthread_cond_signal(&idle_cond);
362   #else
363   #ifdef IDLE_USES_SEMAPHORE
364 +        LOCK_IDLE;
365          if (idle_sem_ok > 1) {
362                LOCK_IDLE;
366                  idle_sem_ok--;
367                  UNLOCK_IDLE;
368                  sem_post(&idle_sem);
369                  return;
370          }
371 +        UNLOCK_IDLE;
372   #endif
373   #endif
374   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines