I currently have a boost thread as such

```
class foo
{
  private:
  boost::shared_ptr<boost::thread> t;
  public:
  foo()
  {
    t = boost::make_shared<boost::thread>(&foo::SomeMethod,this);
  }
  void SomeMethod()
  {
    while(true)
    {
       .... //Does some work
    boost::this_thread::sleep(boost::posix_time::milliseconds(5000)); //sleep for 5 seconds
    }
  }

  void stopThread()
  {
    //Elegant and instant way of stopping thread t
  }
}

```

I have read from [this](http://www.boost.org/doc/libs/1_49_0/doc/html/thread/thread_management.html#interruption_points) post that you have to define interruption points however I am not sure if I understand how that would fit in my scenario. I am looking for a safe elegant way that will ensure that thread t is terminated