added CircularBufferThreadSafe class