~rogpeppe/gozk/factor-out-service

Viewing all changes in revision 5.

  • Committer: Gustavo Niemeyer
  • Date: 2010-12-13 13:07:32 UTC
  • Revision ID: gustavo@niemeyer.net-20101213130732-1ppjruxb14hghlad
Use 'while' with pthread_cond_wait, rather than 'if'.  Even though
there's a single consumer, spurious wakeups [1] might signal the
thread without any elements in the queue.

[1] http://en.wikipedia.org/wiki/Spurious_wakeup

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: