From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: normalperson@yhbt.net Received: from zedshaw.xen.prgmr.com (zedshaw.xen.prgmr.com [64.71.167.205]) by dcvr.yhbt.net (Postfix) with ESMTP id 758BF1F701 for ; Thu, 24 Jan 2013 00:47:49 +0000 (UTC) Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id 958CA21FCB7 for ; Thu, 24 Jan 2013 01:01:04 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 24 Jan 2013 00:47:14 +0000 From: Eric Wong In-Reply-To: <1358988435-16017-1-git-send-email-normalperson@yhbt.net> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Message-Id: <1358988435-16017-1-git-send-email-normalperson@yhbt.net> Precedence: list References: <1358988435-16017-1-git-send-email-normalperson@yhbt.net> Sender: sleepy.penguin@librelist.org Subject: [sleepy.penguin] [PATCH 1/2] epoll: use pthread_once properly To: sleepy.penguin@librelist.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit pthread_once_t must be static to be effective. This bug only affects apps which load sleepy_penguin multiple times. --- ext/sleepy_penguin/epoll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/sleepy_penguin/epoll.c b/ext/sleepy_penguin/epoll.c index 2b7f5c1..7297f70 100644 --- a/ext/sleepy_penguin/epoll.c +++ b/ext/sleepy_penguin/epoll.c @@ -682,7 +682,7 @@ static void epoll_once(void) void sleepy_penguin_init_epoll(void) { VALUE mSleepyPenguin, cEpoll; - pthread_once_t once = PTHREAD_ONCE_INIT; + static pthread_once_t once = PTHREAD_ONCE_INIT; int err = pthread_once(&once, epoll_once); if (err) { -- 1.8.1.46.gcb3a6ab