Re-write the ring buffer code to be lockless.