title: how to share a mutex lock for a group of pthreads ?
body: <p>I'm trying to do some stuff with pthreads and sync them:<br/>
  How could I use mutex just for a group of threads ?<br/> 
  Let's say I have <em>t0,t1, t2, .. t20. pthreads</em> running at the same time, and I want to have a lock for the even numbers threads and other lock for the odd numbers threads... or one lock for the first ten, and other for the rest, or one lock for each one. I mean, grouping pthreads depending on its data (the fourth argument in this funcion:</p>
  
  <blockquote>
    <p>int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *arg);</p>
  </blockquote>
  
  <p>and sharing the mutex for a group of pthreads.</p>
  
  <p>I'm working on a kind of bank project and I want to lock all the phreads trying to access to a same account number. <em>(as critical section CRUD operations)</em><br/>
  Does it make sense ? or there is a better approach to do this ?<br/>
  Thanks in advance for your help and time ;)</p>
  
  <p>J.</p>