title: Passing multiple arguments to threaded function from pthread_create
body: <p>this is my first attempt at threading in C. I am creating a circularly bounded buffer. I know how to create the thread, but all examples I have seen only have threaded functions that accept one void parameter, but unfortunately my worker's specification requires me to use three, as shown here:</p>
  
  <pre><code>void bufferRead(BoundedBuffer* buffer, char* data, int count) {
      pthread_mutex_lock(&amp;buffer-&gt;mutexBuffer);
      &lt;snip&gt;
      pthread_mutex_unlock(&amp;buffer-&gt;mutexBuffer);
  }
  </code></pre>
  
  <p>Here is my pthread_create statement</p>
  
  <pre><code>pthread_create(&amp;buffer.readThread, NULL, (void *)bufferRead, &amp;readParams)
  </code></pre>
  
  <p>And my readParams struct/assignments</p>
  
  <pre><code>struct readThreadParams {                                                   
      BoundedBuffer b;                                                        
      char* data;                                                             
      int count;                                                              
  };                                                                          
  
  struct readThreadParams readParams;                                         
  readParams.b = buffer2;                                                     
  readParams.data = out_array;                                                
  readParams.count = in_size;
  </code></pre>
  
  <p>Any advice on how to assign each of the struct's parameters after passing to the bufferRead function would be greatly appreciated.</p>