made RingBuffer thread safe!

#77