[parisc-linux] Problem with threads..

andi andi@fischlustig.de
30 Dec 2001 22:55:26 +0100


> Just to clarify...
> 
> hppa is the only platform supported by linuxthreads right now where we 
> initialize the mutex variable to 1 so that we can do locking using ldcw. On 
> other platforms, locks are initialized to 0 and locking is done using things 
> like test-and-set.
> 
> In general, you always need to call pthread_mutex_init for mutexes to
> work. In the case of pan, the mutex variable is declared static, so it
> is automatically initialized to 0.

does that mean using the PTHREAD_MUTEX_INITIALIZER as defined in
phread.h (which DirectFB does) does not work on parisc, and we _have_ to
call pthreas_mutex_init()? Why does PTHREAD_MUTEX_INITIALIZER exist
then?


#define PTHREAD_MUTEX_INITIALIZER \
  {0, 0, 0, PTHREAD_MUTEX_TIMED_NP, __LOCK_INITIALIZER}

andi