| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
| Terry, OK, got the idea of that solution. I found another reference to this issue, is it a good one and does it cover my needs? > > typedef struct pthread_mutex_recursive_np_t { > pthread_mutex_t mutex; > pthread_t owner; > UInt32 count; > } pthread_mutex_recursive_np_t; > > void pthread_mutex_lock_recursive_np(pthread_mutex_recursive_np_t *mutex) > { > pthread_t self; > > self = pthread_self(); > if (mutex->owner != self) > { > pthread_mutex_lock(&mutex->mutex); > mutex->owner = self; > mutex->count = 1; > } > else > mutex->count += 1; > } > > void pthread_mutex_unlock_recursive_np(pthread_mutex_recursive_np_t > *mutex) > { > if (--mutex->count == 0) > { > mutex->owner = NULL; > pthread_mutex_unlock(&mutex->mutex); > } > } ======= Cheers, Erez On Jul 19, 2007, at 10:01 AM, Terry Lambert wrote:
//====================== |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/email@hidden This email sent to email@hidden
| References: | |
| >Kernel Recursive mutexes 10.4.9 ++ (From: Erez Kaplan <email@hidden>) | |
| >Re: Kernel Recursive mutexes 10.4.9 ++ (From: Terry Lambert <email@hidden>) | |
| >Re: Kernel Recursive mutexes 10.4.9 ++ (From: Erez Kaplan <email@hidden>) | |
| >Re: Kernel Recursive mutexes 10.4.9 ++ (From: Terry Lambert <email@hidden>) | |
| >Re: Kernel Recursive mutexes 10.4.9 ++ (From: Erez Kaplan <email@hidden>) | |
| >Re: Kernel Recursive mutexes 10.4.9 ++ (From: Terry Lambert <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.