From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 2656C3857418 for ; Mon, 29 Aug 2022 19:35:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2656C3857418 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=foss.st.com Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TCsCxQ017555; Mon, 29 Aug 2022 21:35:04 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=uF0p4QlR39V891B3ilWECkt3ZADgjOyvb335/kCbMog=; b=cahxOZoqo6W+4At6O2taoZj1py6qSWLxdFYnFLPgzNfhljsDR5Zt0p3iZLFal/VXdKEQ s37YAfBS0A8091wrq/hYSZOhLOX1p3vTtaFpbSlmeq01KXzHU+kTaKBlFSDqXGaO5IK/ //gr5XMOknTbnBXE4YRa9XD994sBt4zyx6GoeWc9TGxhsHKoKlA0E+0B/1HMyfdTRhrM 5FRcOY9U1itxgKCFLUfE4hCK1hHi4MUlKgFkF25iyTmN3gXI+TJSRvS+XtAiA/rlYm4b D/NZ6ka8FOHgwv0+O1SXcMtU5p3r8/bKC0MMZsWSp5KL9FMEGOQ/K9zq+b93UQPUJHfo nQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3j7a5huetv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Aug 2022 21:35:04 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0555C10002A; Mon, 29 Aug 2022 21:35:02 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id ED0ED25E512; Mon, 29 Aug 2022 21:35:02 +0200 (CEST) Received: from [10.252.19.84] (10.75.127.117) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2375.7; Mon, 29 Aug 2022 21:35:01 +0200 Message-ID: <2c1fbee9-491c-3e70-7f7f-5896f5e766ee@foss.st.com> Date: Mon, 29 Aug 2022 21:35:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH] Restore _lock initialization in single threaded mode Content-Language: en-US To: Jeff Johnston CC: Newlib References: <20220829151049.3320719-1-torbjorn.svensson@foss.st.com> From: Torbjorn SVENSSON In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.117] X-ClientProxiedBy: GPXDAG2NODE4.st.com (10.75.127.68) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_09,2022-08-25_01,2022-06-22_01 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello Jeff, The description should have included a "not". Sorry about that. Kind regards, Torbjörn On 2022-08-29 21:33, Jeff Johnston wrote: > Hi Torbjorn, > > Could you clarify?  Your description and title says when SINGLE_THREAD, > but your patch is #ifndef __SINGLE_THREAD__. > > -- Jeff J. > > On Mon, Aug 29, 2022 at 11:11 AM Torbjörn SVENSSON > > > wrote: > > When __SINGLE_THREAD__ is defined, stdin, stdout and stderr needs to > have their _lock instance initialized. The __sfp() method is not > invoked for the 3 mentioned fds thus, the std() method needs to handle > the initialization of the lock. > > This is more or less a revert of > 382550072b49430f8c69adee937a0ba07bd385e6 > > Signed-off-by: Torbjörn SVENSSON > > --- >  newlib/libc/stdio/findfp.c | 4 ++++ >  1 file changed, 4 insertions(+) > > diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c > index c43028209..f7249f6d7 100644 > --- a/newlib/libc/stdio/findfp.c > +++ b/newlib/libc/stdio/findfp.c > @@ -88,6 +88,10 @@ std (FILE *ptr, >  #else /* _STDIO_CLOSE_STD_STREAMS */ >    ptr->_close = NULL; >  #endif /* _STDIO_CLOSE_STD_STREAMS */ > +#ifndef __SINGLE_THREAD__ > +  if (ptr == &__sf[0] || ptr == &__sf[1] || ptr == &__sf[2]) > +    __lock_init_recursive (&ptr->_lock); > +#endif >  #ifdef __SCLE >    if (__stextmode (ptr->_file)) >      ptr->_flags |= __SCLE; > -- > 2.25.1 >