Mailing Lists: Apple Mailing Lists

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

Re: POSIX threads - pthread_cancel



It has been my experience that none of the man page's cancellation points work. It quite irritated me, I now have to pepper my code with testcancel()s.

- Dennis

===================================
DrakkenWulf Enterprises

Dennis Piatkowski
Senior Software Engineer

3801 Wyoming
Kansas City MO 64111
816-678-9397
email@hidden
http://home.kc.rr.com/dwulf/


On Mar 12, 2004, at 9:02 AM, Adrian Bool wrote:

Hi Mukeh,

I had a read of the pthread docs.

In your first program the thread should die at one of the cancellation points. According to the docs this includes nanosleep().

You have the 'testcancel()' function in there but instantly passed through it before the request to cancel is made the main() thread.

If you move the testcancel() into your wait loop the child thread cancels nicely.

So, it seems that in OSX nanosleep() for some reason is not being counted as a cancellation point - contrary to the man page documentation. :-(

Regards,

aid
_______________________________________________
darwin-userlevel mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-userlevel
Do not post admin requests to the list. They will be ignored.


References: 
 >POSIX threads - pthread_cancel (From: mukesh bafna <email@hidden>)
 >Re: POSIX threads - pthread_cancel (From: Adrian Bool <email@hidden>)



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.