From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 8 11:27:43 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D68A216A4CE for ; Thu, 8 Jan 2004 11:27:43 -0800 (PST) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC5F743D1D for ; Thu, 8 Jan 2004 11:27:42 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i08JRgiw002730; Thu, 8 Jan 2004 14:27:42 -0500 (EST) Date: Thu, 8 Jan 2004 14:27:42 -0500 (EST) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: rmkml In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: problem with signal handling and threads (fbsd49R) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 19:27:44 -0000 On Thu, 8 Jan 2004, rmkml wrote: > please can you give me an example > of mask to SET BLOCK ou UNBLOCK > in both threads (main and run) > in order to make this sample code working ? man pthread_sigmask sigset_t set; sigemptyset(&set); sigsetadd(&set, SIGINT); pthread_sigmask(SIG_BLOCK, &set, NULL); will block SIGINT. Put that in all threads that you don't want to handle CTRL-C. sigprocmask() instead of pthread_sigmask() will work as well.