pthread_mutex_* on gthread-posix



Hi,
   I just noticed that the 2nd parameter of pthread_mutex_init()
in GThreads's POSIX implementation file uses NULL. That I know
this is ok for the 'latest' POSIX standard, but on the old
standard (Draft-4?) default initialization is provided by
using 'pthread_mutexattr_default' as the 2nd parameter.

I mention this because looking at gthread-posix.c gives me
the impression that the old standard is partially supported,
at least it does for pthread_getspecific().

Then, for pthread_mutex_trylock() gthread-posix only supports
the latest. In the old implementation the resturn values are 
different:

         mutex_trylock()  
         return value        Draft-4    Draft-10
         ---------------     -------    ---------
         already locked         0       [EBUSY]
         OK, got it             1        0
         Oops, error           -1       [EINVAL]

As for other functions, it seems the old one returned -1
and had errno set, whereas the 'latest' simply returns
0 on success or non-zero (the content of errno) on error.
Well, at least that is the generalization I have been able
to make so far in looking at these things. It seems
AIX 4.3 also uses the old threading stuff :(

Sorry I don't have time to try out latest CVS versions,
I have a hard deadline hanging on my neck...

		Cheers,
				Emilio

-- 
D. Emilio Grimaldo Tunon       Compuware Europe B.V. (Uniface Lab)
Software Engineer	       Amsterdam, The Netherlands
emilio_tunon@nl.compuware.com  Tel. +31 (0)20 3126 516
*** The opinions expressed hereby are mine and not my employer's ***



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]