Yes, we could specify the message as a parameter to the functions. But one more important matter, won't data races occur? Both threads use same objects (std::cout, sleep_for()).
Unless sync_with_stdio(false) has been issued, it is safe to concurrently access these objects from multiple threads for both formatted and unformatted output.
Where 'safe' means you're not going to hose the machine by using it.
I'm not sure whether 'safe' would go as far as making sure every composite expression would always result in a whole line.
If the unit of interleaving is every <<, then you're in for a surprise at some point.
If you care about that, then build a string and output the result using a single <<.