wahjam/wahjam — pull request #47 by stefanha (2012-04-15 16:03:31+00:00)
Title: Protect interval length and position with a lock

The audio thread updates the interval position each time new samples are
processed. When the end of the interval is reached, the metronome and
interval length are recalculated. NJClient::GetSessionPosition() can
see inconsistent values where interval position is greater than interval
length because no lock is used. This triggers a Q_ASSERT() in
MetronomeBar.

This patch performs the interval length and position update with a lock
held so that the client thread always sees consistent values. This
fixes the assert.

Signed-off-by: Stefan Hajnoczi