Return-Path: william@bourbon.usc.edu Delivery-Date: Wed Oct 29 19:31:17 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id m9U2VHbi027064 for ; Wed, 29 Oct 2008 19:31:17 -0700 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id m9U2gi3h027679 for ; Wed, 29 Oct 2008 19:42:44 -0700 Message-Id: <200810300242.m9U2gi3h027679@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: CPU Hog Date: Wed, 29 Oct 2008 19:42:44 -0700 From: Bill Cheng Someone wrote: > I am using pthread_sigmask to unblock the SIGINT signal in my command line > handler thread. I am catching and handling the signal in the same thread. > But my thread is not able to catch more than one SIGINT. I called sighandler > within sighandler but nothing seems to be working. My program terminates on > the second Ctrl+C. I just tried the code in "man pthread_sigmask" again (with a little modification so that it loops forever) and it seems to work just fine. I can send after and it kept going. In that code, it uses sigaction() to specify a signal handler. Are you doing that? Or are you using signal()? -- Bill Cheng // bill.cheng@usc.edu