| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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 __
| References: | |
| >Process Shared Mutex (From: Dario <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.