Changed circ.buff. to count based, added write mutex