| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I think you are assuming behavior that isn't specified. Specifically, the definition for pthread_cond_destroy() says: The pthread_cond_destroy() function shall destroy the given condition variable specified by cond; the object becomes, in effect, uninitialized. An implementation may cause pthread_cond_destroy() to set the object referenced by cond to an invalid value. A destroyed condition variable object can be reinitialized using pthread_cond_init(); the results of otherwise referencing the object after it has been destroyed are undefined. So, trying to call pthread_cond_signal() from another thread after the condition is destroyed (or even "during" it being destroyed) can result is undefined behavior. You really need synchronization of your own to avoid issues there. Using the same mutex would have been good enough. Since that isn't in your model, you need something else (maybe a second condition variable that indicates whether the first has been destroyed? - just thinking out loud). --Jim On Jan 9, 2008, at 2:25 AM, Kazuho Oku wrote: Hi, |
_______________________________________________ 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: | |
| >A Bug in pthread_cond_destroy? (From: "Kazuho Oku" <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.