On Sun, 2005-05-08 at 11:37 +0200, Fons Adriaensen wrote:
On Sun, May 08, 2005 at 08:22:24AM +0200, Jens M
Andreasen wrote:
If so, then pthread_cancel() should work just
fine together with the
workaround described under BUGS in man pthread_cancel.
Using pthread_cancel() is exactly what I want to avoid at all cost.
In my world, threads are both the thing managaed by the system +
threads library, and a C++ object. If the thread is cancelled that
can make it virtually impossible to cleanup the object in an orderly
fashion. It may for example have to wait for a message confirming that
others that depend on its existence know it's going to disappear, and
are prepared for that. Also, the pthread itself is just a private
implementation detail of the object and can not be accessed from
the outside without breaking the abstraction.
Can't you use:
void pthread_cleanup_push(void (*routine) (void *), void *arg);
void pthread_cleanup_pop(int execute);
?
--
(
)
c[] // Jens M Andreasen