title: Confirmation of thread safety with std::unique_ptr/std::shared_ptr
body: <p>My application has an IRC module that essentially is a normal client. Since this is heavily threaded, I stand the risk of a plug-in retrieving, for example, a users nickname - it is valid at the time, but the parser triggers an update, changing said nickname. 
  Once the other thread has execution again, it's dealing with a pointer to now-invalid memory, since it'll be impossible to have the return + copy as an atomic operation.</p>
  
  <p>Is my assumption about this correct, based on the code below? As such, I guess I'd have to use the usual mutex lock/unlock method, unless someone can confirm or suggest otherwise (I'd rather not have to convert and return a shared_ptr, but I guess it is a valid option, it's just I intend on SWIG'ing this and don't know if it wouldn't like them).</p>
  
  <p>IrcUser.h</p>
  
  <pre><code>class IrcUser : public IrcSubject
  {
  private:
      ...
      std::shared_ptr&lt;std::string&gt;    _nickname;
      std::shared_ptr&lt;std::string&gt;    _ident;
      std::shared_ptr&lt;std::string&gt;    _hostmask;
  public:
      ...
      const c8*
      Ident() const
      { return _ident.get()-&gt;c_str(); }
  
      const c8*
      Hostmask() const
      { return _hostmask.get()-&gt;c_str(); }
  
      const u16
      Modes() const
      { return _modes; }
  
      const c8*
      Nickname() const
      { return _nickname.get()-&gt;c_str(); }
  
      bool
      Update(
          const c8 *new_nickname,
          const c8 *new_ident,
          const c8 *new_hostmask,
          const mode_update *new_modes
      );
  };
  </code></pre>
  
  <p>IrcUser.cc</p>
  
  <pre><code>bool
  IrcUser::Update(
      const c8 *new_nickname,
      const c8 *new_ident,
      const c8 *new_hostmask,
      const mode_update *new_modes
  )
  {
      if ( new_nickname != nullptr )
      {
          if ( _nickname == nullptr )
          {
              *_nickname = std::string(new_nickname);
          }
          else
          {
              _nickname.reset();
              *_nickname = std::string(new_nickname);
          }
  
          Notify(SN_NicknameChange, new_nickname);
      }
  
      ...
  }
  </code></pre>