From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v2 3/4] eal: set name when creating a control thread Date: Tue, 10 Apr 2018 17:34:36 +0100 Message-ID: References: <20180403130439.11151-1-olivier.matz@6wind.com> <20180403130439.11151-4-olivier.matz@6wind.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit To: Olivier Matz , dev@dpdk.org Return-path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 8A4C71BAE4 for ; Tue, 10 Apr 2018 18:34:38 +0200 (CEST) In-Reply-To: <20180403130439.11151-4-olivier.matz@6wind.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 03-Apr-18 2:04 PM, Olivier Matz wrote: > To avoid code duplication, add a parameter to rte_ctrl_thread_create() > to specify the name of the thread. > > This requires to add a wrapper for the thread start routine in > rte_thread_init(), which will first wait that the thread is configured. > > Signed-off-by: Olivier Matz > --- <...> > + > + pthread_barrier_wait(¶ms.configured); > + > + return 0; > + > +fail: > + pthread_kill(*thread, SIGTERM); This may be wrong, but perhaps instead of killing the thread outright, a better approach would be pthread_cancel? I'm always uneasy about mixing signals and pthreads... > + pthread_join(*thread, NULL); > + return ret; > } -- Thanks, Anatoly