~ubuntu-branches/ubuntu/feisty/basilisk2/feisty

« back to all changes in this revision

Viewing changes to src/Unix/timer_unix.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2006-06-01 01:11:16 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060601011116-xjhegbgyfsxag5fl
Tags: 0.9.20060529-1
* New upstream CVS snapshot.
* Update local cdbs snippet copyright-check.mk:
  + Broaden scan to also look for "(c)" by default.
  + Make egrep options configurable.
  + Ignore auto-tools files.
* Bump up standards-version to 3.7.2 (no changes needed).
* Let dh_strip do the stripping (not the make install target).

Show diffs side-by-side

added added

removed removed

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