Thread safety of std::string

A thing that has been in the back of my mind for quite a while: is std::string threadsafe? Normal STL containers are not but std::string internally uses a copy-on-write mechanism which can screw things up (if the bookkeeping is not adequately protected). Thankfully, StackOverflow comes nicely to the rescue here: