Google Interview Question

Implement a circular buffer ; make it thread-safe