Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mutex

Status
Not open for further replies.

konsri

Programmer
Feb 1, 2002
13
0
0
US
pthread_mutex_lock is returning 22.
Whats this 22 is?

Thanks
Srikanth
 
You should check your man page and you should see somrthing
like...

ERRORS
The pthread_mutex_lock function returns the following
error code on error:

EINVAL the mutex has not been properly initialized.


EDEADLK
the mutex is already locked by the calling
thread (``error checking'' mutexes only).


As defined in the errno.h file...
#define EINVAL 22 /* Invalid argument */
 
Is pthread_mutex_init on AIX is synchronous call async?
Thanks
Srikanth
 
I'm not exactly clear on your question.
In AIX 4.3, the mutex "attributes" are not used.
Therefore, you can probably just use the default
initialization... pthread_mutex_init(&mymutex, NULL)

You must call this prior to using that mutex. You should
NOT attempt to re-init the same mutex more than once
unless interleaved by a call to pthread_mutex_destroy.
So if I understand your question correctly, my answer
would be "synchronous".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top