Profitap interview question

How to implement a thread and RAII safe stack