title: std::string append thread safe naive solution?
body: <p>I want to make std::string append function thread safe, because I am appending a specific string from different threads.</p>
  
  <p>I'm a quite beginner in c++ so I'm not sure what problems this may rise.</p>
  
  <p>The solution I am thinking about is instead of using <code>somestring.append("appendthis");</code></p>
  
  <p>Use the following code:</p>
  
  <pre><code>bool appendtsReady = true;
  void appendts(std::string&amp; originalString, char* app)
  {
      while (!appendtsReady) {}
  
      appendtsReady = false;
      originalString.append(app);
      appendtsReady = true;
  }
  
  appendts(somestring, "appendthis");
  </code></pre>
  
  <p>I would hope that if the string is being appended the new request 
  <code>appendts(somestring, "appendthis_from_different_thread");</code> will be caught on loop until previous append is finished.</p>
  
  <p>Is this solution is too naive?</p>