Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Process Shared Mutex



I don't know if this is the right place for this question, but I don't
think this is a carbon,cocoa or java question
I have a problem with this code. I use this to init my mutex to be
process shared.
But this code always returns errno = 2 when tring to set mutex attr to
be process shared...

int pthread_mutex_setup( pthread_mutex_t *mutex ) {
pthread_mutexattr_t attr;
if( pthread_mutexattr_init( &attr ) != 0 ) return -1;
if( pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED )
!= 0 ) {
pthread_mutexattr_destroy( &attr );
printf("errno:%d",errno);
return -1;
}
if( pthread_mutex_init( mutex, &attr ) != 0 ) {
pthread_mutexattr_destroy( &attr );
return -1;
}
pthread_mutexattr_destroy( &attr );
return 0;
}

##### ##### #####

__ iteration is human, recursion is divine __
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.