From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 4354 invoked from network); 20 Jun 2023 00:25:46 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 20 Jun 2023 00:25:46 -0000 Received: (qmail 5757 invoked by uid 550); 20 Jun 2023 00:25:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 5640 invoked from network); 20 Jun 2023 00:25:36 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687220724; x=1689812724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HRWYoaxdSzbqlxLDvXEfk6PvAhINFm+WBvQGzuItYXs=; b=Q9ZZmFeVFpvSNUUIs3AFO97MTgAU/XbCKTl1hx4X1bo9Dj01v6Z69ua47Y7+Lcg+3O oc5/rN2LFqrbip8zKb5snJJDEHWEtAh7JT9yIMICl/8IroYEpCWfJrWjJwLD17Zd+RCh UbgjV7cvajwlapIq5FBr0zxZo6ZRRNwSyItqpEMoa+Kve+mgNHj15NLwI45ehgv9o2Xz Eg/j1hI2p9RJO7SFOooXDMwP8Uv8UL+iQTo7NigKFS69E7dRqpPwPCHOz3Uo/G7ddcDw 7g0KLu4CP944qbVIFVoThGJB1o55JZ6tzy9Ngj/eLSWyFrSkMocsVENT3iumo2Ezch1v mEsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687220724; x=1689812724; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HRWYoaxdSzbqlxLDvXEfk6PvAhINFm+WBvQGzuItYXs=; b=JLHfRKKJXaNgl37d2aS2ZExy+7K4JdIyZ2wuk9lADxUaq80KUJveXQ4YHxGqe1Z47Z kBWnvw0rknEV1w3cnNfaXyj2T1LlO6A1cssdCJumt9DAM0kP5Rt0+O3aoFPBY4dzc4qS hAdUXeKiz7aafXoJLVpWnlglxHl98qktIq/6CRf0GHUhpwxVmR/mcU0hBRY4TROaq1ne MuELUQpUkrpxBIfY3/VzlK2zeQwHT/+qdakFwLA3zj0TUOcgug/PRzZpHGAxbGpnGhX1 iEGudahUSxs1FIr+dChgnLt78RaFIbEm9doz1vGgwqdmvdM1il43smtVoD6v05boIMzj Bu9w== X-Gm-Message-State: AC+VfDyvjDpuL9fNSgw7e7zTCa8h3JYn//v0G/vy/hpclLk7B2xQEE0e yyw7ympA/pWxj131bc6RqJQ= X-Google-Smtp-Source: ACHHUZ7urUDPvOSNvUusXDuhhBeU6tuhEAUil6jpCwA89R7DQ6ZUOEDmmdlpuoFQ7+V5dPWbccapdw== X-Received: by 2002:a9d:6193:0:b0:6b4:72e9:c87d with SMTP id g19-20020a9d6193000000b006b472e9c87dmr3033780otk.3.1687220724313; Mon, 19 Jun 2023 17:25:24 -0700 (PDT) From: Yonggang Luo To: Jens Gustedt , musl@lists.openwall.com Cc: Yonggang Luo Date: Tue, 20 Jun 2023 08:25:04 +0800 Message-Id: <20230620002507.796-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.39.0.windows.1 In-Reply-To: <20230620002507.796-1-luoyonggang@gmail.com> References: <20230620002507.796-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH 1/4] trim spaces of pthread_cond_timedwait.c and pthread_mutex_timedlock.c Signed-off-by: Yonggang Luo --- src/thread/pthread_cond_timedwait.c | 6 +++--- src/thread/pthread_mutex_timedlock.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thread/pthread_cond_timedwait.c b/src/thread/pthread_cond_timedwait.c index 6b761455..c5b35a6c 100644 --- a/src/thread/pthread_cond_timedwait.c +++ b/src/thread/pthread_cond_timedwait.c @@ -121,12 +121,12 @@ int __pthread_cond_timedwait(pthread_cond_t *restrict c, pthread_mutex_t *restri * via the futex notify below. */ lock(&c->_c_lock); - + if (c->_c_head == &node) c->_c_head = node.next; else if (node.prev) node.prev->next = node.next; if (c->_c_tail == &node) c->_c_tail = node.prev; else if (node.next) node.next->prev = node.prev; - + unlock(&c->_c_lock); if (node.notify) { @@ -156,7 +156,7 @@ relock: if (val>0) a_cas(&m->_m_lock, val, val|0x80000000); unlock_requeue(&node.prev->barrier, &m->_m_lock, m->_m_type & (8|128)); } else if (!(m->_m_type & 8)) { - a_dec(&m->_m_waiters); + a_dec(&m->_m_waiters); } /* Since a signal was consumed, cancellation is not permitted. */ diff --git a/src/thread/pthread_mutex_timedlock.c b/src/thread/pthread_mutex_timedlock.c index 9279fc54..87f89287 100644 --- a/src/thread/pthread_mutex_timedlock.c +++ b/src/thread/pthread_mutex_timedlock.c @@ -66,7 +66,7 @@ int __pthread_mutex_timedlock(pthread_mutex_t *restrict m, const struct timespec if (r != EBUSY) return r; if (type&8) return pthread_mutex_timedlock_pi(m, at); - + int spins = 100; while (spins-- && m->_m_lock && !m->_m_waiters) a_spin(); -- 2.39.0.windows.1