I have multiple threads using "printf". "Printf" is not thread safe. So can I use a mutex around it to make it thread safe? Or are there still concurrency issues?
// member
std::mutex mtxTcp;
// inside a function
mtxTcp.lock();
printf("Hello %d\n", u16Id);
mtxTcp.unlock();