UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

#1 2006-10-07 06:53 AM

EltonSky
Member
Registered: 2006-09-04
Posts: 24

Re: Signal for pthread cancelation

Hello,

I wanna catch a signal when using pthread_cancle(). Can anybody tell me the correspoding signal?

Or, Can I use user defined signal for this?

Regards,

Elton

Offline

#2 2006-10-08 12:10 AM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: Signal for pthread cancelation

Unfortunately there isn't a signal required to be generated on cancellation... if you look at the pthread docs you will see that they did consider implementing something of that nature but eventually decided against it...

This doesn't mean that you cannot have a cancelled thread generate a signal... just use the pthread_cleanup_push / pthread_cleanup_pop functions ( macros usually ) to set a function to be run on cancellation... and have that function generate the signal of your choice...

Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

Board footer

Powered by FluxBB