title: Random error on mutex lock
body: <p>A mutex lock succeeds or fails randomly, and fails with either :</p>
  
  <pre><code>Invalid argument
  </code></pre>
  
  <p>or</p>
  
  <pre><code>tpp.c:62: __pthread_tpp_change_priority: Assertion `new_prio == -1 || (new_prio &gt;= __sched_fifo_min_prio &amp;&amp; new_prio &lt;= __sched_fifo_max_prio)' failed.
  </code></pre>
  
  <p>The code is very basic as you can  see here :</p>
  
  <pre><code>pthread_mutex_t mutex;
  main() {
    int ret;
    pthread_mutexattr_t attr;
    pthread_mutexattr_setpshared(&amp;attr, PTHREAD_PROCESS_SHARED);
    ret = pthread_mutex_init(&amp;mutex, &amp;attr);
    if (ret != 0) {
      printf("pthread_mutex_init\n");
      return 1;
    }
    ret = pthread_mutex_lock(&amp;mutex);
    if (ret != 0) {
      printf("mutex_lock failed %s\n", strerror(ret));
      return 1;
    }
    ret = pthread_mutex_unlock(&amp;mutex);
    if (ret != 0) {
      printf("mutex_unlock failed %s\n", strerror(ret));
      return -1;
    }
  </code></pre>
  
  <p>Why is that ?</p>