Yahoo interview question

how to implement a thread safe data structure