title: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’ - pthreads
body: <pre><code>anisha@linux-y3pi:~&gt; g++ conditionVarTEST.cpp -Wall
  
  conditionVarTEST.cpp: In function ‘int main()’:
  conditionVarTEST.cpp:33:53: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’
  conditionVarTEST.cpp:33:53: error:   initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)’
  conditionVarTEST.cpp:34:53: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’
  conditionVarTEST.cpp:34:53: error:   initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)’
  </code></pre>
  
  <hr>
  
  <p>Line number 33 is this:  </p>
  
  <pre><code>pthread_create (&amp;A, NULL, (void *) &amp;functionA, NULL);
  </code></pre>
  
  <hr>
  
  <p>Declaration of <code>functionA</code> is this:  </p>
  
  <p><code>void functionA (void*);</code></p>
  
  <hr>
  
  <p>Its definition is:</p>
  
  <pre><code>void functionA (void* argA)
  {
      while (1)
      {
          pthread_mutex_lock (&amp;mutexA);
  
          if (count &lt; 0)
          {
              pthread_cond_wait (&amp;conditionVariableA, &amp;mutexA);
          }
          else
          {
              // Do something.
              std :: cout &lt;&lt; "\nTime to enjoy!";
          }
          pthread_mutex_unlock (&amp;mutexA);
      }
  }
  </code></pre>