From commits-return-9408-archive-asf-public=cust-asf.ponee.io@nuttx.apache.org Mon May 11 04:28:04 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id F11A5180663 for ; Mon, 11 May 2020 06:28:03 +0200 (CEST) Received: (qmail 12803 invoked by uid 500); 11 May 2020 04:28:03 -0000 Mailing-List: contact commits-help@nuttx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@nuttx.apache.org Delivered-To: mailing list commits@nuttx.apache.org Received: (qmail 12743 invoked by uid 99); 11 May 2020 04:28:03 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 May 2020 04:28:03 +0000 From: =?utf-8?q?GitBox?= To: commits@nuttx.apache.org Subject: =?utf-8?q?=5BGitHub=5D_=5Bincubator-nuttx=5D_xiaoxiang781216_commented_on_a_?= =?utf-8?q?change_in_pull_request_=231023=3A_Fix_setlogmask=28=29_not_to_use?= =?utf-8?q?_enter=5Fcritical=5Fsection=28=29_in_protected_build?= Message-ID: <158917128270.4590.7300062313245852581.asfpy@gitbox.apache.org> Date: Mon, 11 May 2020 04:28:02 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit References: In-Reply-To: xiaoxiang781216 commented on a change in pull request #1023: URL: https://github.com/apache/incubator-nuttx/pull/1023#discussion_r422773452 ########## File path: libs/libc/syslog/lib_setlogmask.c ########## @@ -91,17 +96,29 @@ uint8_t g_syslog_mask = LOG_ALL; int setlogmask(int mask) { uint8_t oldmask; + +#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__) Review comment: The better fix is either: 1.remove the critical section or 2.replace with mutex/semphare The mix just make the logic more complex and unmaintainable ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org