title: crash on pthread_cond_timedwait and pthread_mutex_lock
body: <p>This is thread A code.</p>
  
  <pre><code>void sleep(Data x)
  {
      pthread_mutex_lock( &amp;(X-&gt;lock) );
      struct timeval  _T;
      gettimeofday( &amp;_T, 0 );
      T.tv_sec = _T.tv_sec;
      T.tv_nsec = 1000 * _T.tv_usec;
      pthread_cond_timedwait( &amp;(x-&gt;condition), &amp;(x-&gt;lock), &amp;T );
      x-&gt;value = 0;
      pthread_mutex_unlock( &amp;(x-&gt;lock) );
  }
  </code></pre>
  
  <p>Below is thread B code</p>
  
  <pre><code>void wakeup(Data y)
  {
  
      pthread_mutex_lock( &amp;(y-&gt;lock) );
      y-&gt;value = 1;
      pthread_cond_signal( &amp;(y-&gt;condition) );
      pthread_mutex_unlock( &amp;(y-&gt;lock) );
  }
  struct Data {
      pthread_cond_t  condition;
      pthread_mutex_t lock;
      int             value;
  } ;
  </code></pre>
  
  <p>I am facing a crash in a multithreaded system. Where as per bt one thread (A) is showing in <code>pthread_cond_timedwait</code> and other thread (B) is in <code>pthread_mutex_lock</code>. Thread B got some data to wake up thread A.
  Crash is happening at the same time as passed as timeout <code>pthread_cond_timedwait</code>. Crash is showing in thread B. As per bt value is "0". </p>
  
  <p>In the code section please don't look for syntax mistakes. All the variables are initilized properly</p>