From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3842EA0C47; Tue, 12 Oct 2021 18:29:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05B63410DF; Tue, 12 Oct 2021 18:29:03 +0200 (CEST) Received: from new1-smtp.messagingengine.com (new1-smtp.messagingengine.com [66.111.4.221]) by mails.dpdk.org (Postfix) with ESMTP id 944BD410DB for ; Tue, 12 Oct 2021 18:29:01 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id EA200580BCA; Tue, 12 Oct 2021 12:29:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Tue, 12 Oct 2021 12:29:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm2; bh= OhnEKF+siR7e9gUMdtZjseslvdQvR08T30hcp8SDEds=; b=lv93pqsXQuPdyyv6 JxWIlLdYmweWcpiiZvuQb4npcQxkJK/l5N6Mg0Qws0rs+6TpJCHujlCKD3U89nYn 5EQPGo9AAJgO1V/dnDPJ1IrRCz5IftCev11J0OOtj8qx8/h5LVDCbJdIwTwbXaO4 aiuYk23e2cTpceuQyy/2dHBJ7MXCOqQxfopxVNuOQQLzAOREmVsaCDArmHtESOdw 8Q6mx8VdUNX2O08BDFvULkVJJoPpacXgYFd0NdhCmFe1MZfVsNoGFtbYtyxyrSFC cdBmfvasjnXLDa2aFF8avgcfuVuWyIFfcMcdF80sPmS2Fi6wylrLH6gWw9v2EH3m kygoRA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OhnEKF+siR7e9gUMdtZjseslvdQvR08T30hcp8SDE ds=; b=RtomTeAFzAdRJ8Y2DcKT5lDjuAO//ahNWgnb35PakWa9dlswIq9k+/dMl AYxSYSoFXby8CRhWacXeRhzQrJv9g9VG7vyTZlP5MnUkTp3CkqV/NQ8zTr7LJWYf Tv3AEWbC2SlFWVNnD06i/C9nnNyf5lRFv7sRQAhnTD+mcbCK6237fcbuBWMv3E/3 tkg2ZLr7Cg71yb+/nlrmJWrevuznVEeCErbzuy6+SQl6aoeMYpDyHfnGUv8j8U3b gsJdJ5cgNLReKKUSVVYFpJ7c1goYFoagPR3vcvL3uo2Av8OPivZH2LrWF7rtHuLC n7WUUOsvbzYG9JVdWgW4vGkbES/Sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtkedgleekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Oct 2021 12:28:59 -0400 (EDT) From: Thomas Monjalon To: Narcisa Ana Maria Vasile Cc: dev@dpdk.org, dmitry.kozliuk@gmail.com, khot@microsoft.com, dmitrym@microsoft.com, roretzla@microsoft.com, talshn@nvidia.com, ocardona@microsoft.com, bruce.richardson@intel.com, david.marchand@redhat.com, pallavi.kadam@intel.com Date: Tue, 12 Oct 2021 18:28:56 +0200 Message-ID: <77814428.nxW8SpuB8v@thomas> In-Reply-To: <1633765318-28356-8-git-send-email-navasile@linux.microsoft.com> References: <1633732841-17873-1-git-send-email-navasile@linux.microsoft.com> <1633765318-28356-1-git-send-email-navasile@linux.microsoft.com> <1633765318-28356-8-git-send-email-navasile@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v16 7/9] eal: implement functions for mutex management X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 09/10/2021 09:41, Narcisa Ana Maria Vasile: > From: Narcisa Vasile > > Add functions for mutex init, destroy, lock, unlock, trylock. > > Add RTE_STATIC_MUTEX macro to replace static initialization > of mutexes. > Windows does not have a static initializer. > Initialization is only done through InitializeCriticalSection(). > > The RTE_STATIC_MUTEX calls into the rte_thread_mutex_init() > function that performs the actual mutex initialization. [...] > --- a/lib/eal/include/rte_thread.h > +++ b/lib/eal/include/rte_thread.h > +#define RTE_DECLARE_MUTEX(private_lock) rte_thread_mutex private_lock > + > +#define RTE_DEFINE_MUTEX(private_lock)\ > +RTE_INIT(__rte_ ## private_lock ## _init)\ > +{\ > + RTE_VERIFY(rte_thread_mutex_init(&private_lock) == 0);\ > +} > + > +#define RTE_STATIC_MUTEX(private_lock)\ > +static RTE_DECLARE_MUTEX(private_lock);\ > +RTE_DEFINE_MUTEX(private_lock) This is not truly static. It is a wrapper to init the mutex in the constructor. Should we rename?