monitor<T>
Implemented thread-safe sync_cout