From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19346 invoked by alias); 20 Dec 2002 00:53:49 -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 19338 invoked from network); 20 Dec 2002 00:53:48 -0000 Received: from unknown (HELO d12lmsgate-2.de.ibm.com) (194.196.100.235) by 209.249.29.67 with SMTP; 20 Dec 2002 00:53:48 -0000 Received: from d12relay02.de.ibm.com (d12relay02.de.ibm.com [9.165.215.23]) by d12lmsgate-2.de.ibm.com (8.12.3/8.12.3) with ESMTP id gBK0rZ4l028874 for ; Fri, 20 Dec 2002 01:53:35 +0100 Received: from d12ml007.de.ibm.com (d12ml007_cs0 [9.165.223.36]) by d12relay02.de.ibm.com (8.12.3/NCO/VER6.4) with ESMTP id gBK0rZoN040204 for ; Fri, 20 Dec 2002 01:53:35 +0100 In-Reply-To: <8179ED123ECCD611A5490000F822E6EA061BCA@pd001649.daronmont.com.au> Importance: Normal MIME-Version: 1.0 Sensitivity: To: pthreads-win32@sources.redhat.com Subject: RE: Cancellation points Message-ID: From: "Alexander Terekhov" Date: Thu, 19 Dec 2002 16:53:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2002/txt/msg00129.txt.bz2 Simon Gerblich wrote: [...] > Is it correct if I put pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) ^^^^ > after the small piece of code where I don't want a cancelation point? It's correct as long as you use it properly; with proper arguments. AFAICS, the use of null pointer for "oldstate"/"oldtype" is incorrect. http://www.opengroup.org/onlinepubs/007904975/functions/pthread_setcancelstate.html regards, alexander. Sent by: pthreads-win32-owner@sources.redhat.com To: pthreads-win32@sources.redhat.com cc: Subject: RE: Cancellation points >BTW, > >> pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) > ^^^^ > >that's incorrect. Don't do this. > >regards, >alexander. alexander, Is it correct if I put pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) after the small piece of code where I don't want a cancelation point? I am aware that if I start using pthread_setcancelstate() in my code I should take care to use the "oldstate" as described in the RATIONALE and restore the state correctly. I was only using pthread_setcancelstate to confirm if there was a problem with the pthread_mutex_lock() function in the 2002-11-04 snapshot. Thanks, Simon