From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32483 invoked by alias); 16 Nov 2002 16:24:44 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 32475 invoked from network); 16 Nov 2002 16:24:42 -0000 Received: from unknown (HELO hss.hns.com) (164.164.94.118) by sources.redhat.com with SMTP; 16 Nov 2002 16:24:42 -0000 Received: from sampark.hss.hns.com (sampark [139.85.229.22]) by hss.hns.com (8.11.6/8.11.2) with SMTP id gAGG5Fi28804; Sat, 16 Nov 2002 21:35:16 +0530 Received: by sampark.hss.hns.com(Lotus SMTP MTA Internal build v4.6.2 (651.2 6-10-1998)) id 65256C73.0059DCFD ; Sat, 16 Nov 2002 21:51:32 +0530 X-Lotus-FromDomain: HSSBLR From: ssundaragopalan@hss.hns.com To: pankaj bathwal cc: pthreads-win32@sources.redhat.com Message-ID: <65256C73.0059DCB4.00@sampark.hss.hns.com> Date: Sat, 16 Nov 2002 08:24:00 -0000 Subject: Re: pthread_cancel doesn't work Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline X-SW-Source: 2002/txt/msg00111.txt.bz2 Hi pankaj, In Windows, threads get cancelled only in CANCELLATION POINTS. So you *cannot* expect your thread to get cancelled as soon as you cancel the thread by calling pthread_cancel. So,unless it comes across a cancellation point it wont get cancelled. I suggest you to do a explicit pthread_testcancel() in your thread which is a defined cancelleation point and the thread will relinquish when it encounters this. some possible scenarios where a thread might not get cancelled are > Listening in a socket > waiting for a user input from console(getchar()) regds, srikanth pankaj bathwal on 11/16/2002 11:17:31 AM To: pthreads-win32@sources.redhat.com cc: (bcc: Srikanth Sundaragopalan/HSSBLR) Subject: pthread_cancel doesn't work Hi, I am trying to cancel a running thread. I an using "pthread_cancel" function. I have set cancel state as PTHREAD_CANCEL_ENABLE using function "pthread_setcancelstate" but execution of my thread does not stop. what's wrong?? Do I have to something more?? Can I have a sample code?? Thanks Pankaj __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - Let the expert host your site http://webhosting.yahoo.com