title: Suspend pthreads without using condition
body: <p>I want to suspend pthreads but apparently, there is no such function as pthread_suspend. I read somewhere about suspending pthreads using mutexes and conditions and used it as following:</p>
  
  <pre><code>#include &lt;pthread.h&gt;
  
  class PThread {
  public:
  pthread_t myPthread;
  pthread_mutex_t m_SuspendMutex;
  pthread_cond_t m_ResumeCond;
  
  void start() {
  pthread_create(&amp;myPthread, NULL, threadRun, (void*)this );
  }
  
  Thread() { }
  
  void suspendMe() {
  pthread_cond_wait(&amp;m_ResumeCond,&amp;m_SuspendMutex);
  }
  
  void resume() {
  pthread_cond_signal(&amp;m_ResumeCond);
  }
  };
  </code></pre>
  
  <p>but I don't understand why we need both mutex and condition to suspend and resume a pthread. Is it possible to suspend and resume it without using conditions?</p>