From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id F216D21847; Wed, 2 May 2018 04:42:55 +0000 (UTC) Date: Wed, 2 May 2018 04:42:55 +0000 From: Eric Wong To: spew@80x24.org Subject: [PATCH 5/4] thread_sync.c (mutex_lock): add missing else Message-ID: <20180502044255.GA30679@80x24.org> References: <20180501080844.22751-1-e@80x24.org> <20180501080844.22751-5-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180501080844.22751-5-e@80x24.org> List-Id: We do not want to trigger GC if we successfully acquire mutex. [ruby-core:86816] --- Will squash thread_sync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thread_sync.c b/thread_sync.c index 86a102151ef..3eb570857e9 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -297,7 +297,7 @@ rb_mutex_lock(VALUE self) if (mutex->th == th) { mutex_locked(th, self); } - if (do_gc) { + else if (do_gc) { /* * Likely no point in checking for GVL contention here * this Mutex is already contended and we just yielded -- EW