From patchwork Fri Jan 22 18:13:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 60172 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp7358lbb; Fri, 22 Jan 2016 10:14:37 -0800 (PST) X-Received: by 10.140.217.67 with SMTP id n64mr5861418qhb.26.1453486477399; Fri, 22 Jan 2016 10:14:37 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id c134si8214634qkb.124.2016.01.22.10.14.29; Fri, 22 Jan 2016 10:14:37 -0800 (PST) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id D50C061749; Fri, 22 Jan 2016 18:14:28 +0000 (UTC) Authentication-Results: lists.linaro.org; dkim=fail reason="verification failed; unprotected key" header.d=linaro.org header.i=@linaro.org header.b=FxPtR8aN; dkim-adsp=none (unprotected policy); dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id A146D604F6; Fri, 22 Jan 2016 18:14:24 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 50E11617BD; Fri, 22 Jan 2016 18:14:23 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by lists.linaro.org (Postfix) with ESMTPS id 46033604F6 for ; Fri, 22 Jan 2016 18:14:22 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id h129so52644196lfh.3 for ; Fri, 22 Jan 2016 10:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=by9hJcgHXGQvM6zrCNnH5XVFLQGPGhcfPSnbF3t5DCY=; b=FxPtR8aNwfMKn2ElCfZpvoVw+wrtNB8kqAVOU9v+bmSE7jTUM0NbLLTR7WxqTOU8bn 90nBvm3yQgKhmseTxIe80qp6NXoZAG7GCC74YAn5pXZR6nxJZSGL9rIbFxoBO91+eDq9 JC2c0GZhX0hSk57qQv2w7U2yal3ZdhlU7rzpo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=by9hJcgHXGQvM6zrCNnH5XVFLQGPGhcfPSnbF3t5DCY=; b=UMrnFjNNFgGxv3n50UuVB8xn4Ypq9FYqMjGiSjzSYZRb/wHafqPgEsKaoLN+q/x3yc djxMS0KgorcZTqNjQP9wUDRLae6Yv6qtQc8DVeDTC3xs1R8Dnt+gmlPoetBGIjWoUbMl JtnLR0Q2RULDS5Tca6jT0YD1KKxxoXbWCFoIeNuDV76TH2g9SRqOYcydydAl7bzpVJ7M yznBS740cBaPbZDA49YgU6Jypjezyqi7q7jM12CT5BXOu/l40XE6HBt7ggu0hxOLJ84v FA+3DyCr8YP283N5oNWZYZAzLmnXUJ1XaL/gqGllp3+wOlzmLsfLAIqiRUm4QKpMxj60 36XQ== X-Gm-Message-State: AG10YOQNInv57tal+Bl7/5lHnm0JLwB7WyEkbyRPkAyvqkBLDutW9ttGN9IzVzPO6jnG65zQQ/8= X-Received: by 10.25.143.17 with SMTP id r17mr1810191lfd.37.1453486461167; Fri, 22 Jan 2016 10:14:21 -0800 (PST) Received: from localhost.localdomain ([195.238.92.128]) by smtp.gmail.com with ESMTPSA id f202sm1036240lfg.12.2016.01.22.10.14.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 22 Jan 2016 10:14:20 -0800 (PST) From: Ivan Khoronzhuk To: lng-odp@lists.linaro.org Date: Fri, 22 Jan 2016 20:13:11 +0200 Message-Id: <1453486391-20353-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCH v2] validation: shmem: sync threads with barrier X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" It's not convenient to see reused a thread id for threads that are finished to fast. Signed-off-by: Ivan Khoronzhuk Reviewed-by: Bill Fischofer --- test/validation/shmem/shmem.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/validation/shmem/shmem.c b/test/validation/shmem/shmem.c index 5524b5c..08425e6 100644 --- a/test/validation/shmem/shmem.c +++ b/test/validation/shmem/shmem.c @@ -13,6 +13,8 @@ #define TEST_SHARE_FOO (0xf0f0f0f0) #define TEST_SHARE_BAR (0xf0f0f0f) +static odp_barrier_t test_barrier; + static void *run_shm_thread(void *arg) { odp_shm_info_t info; @@ -20,6 +22,7 @@ static void *run_shm_thread(void *arg) test_shared_data_t *test_shared_data; int thr; + odp_barrier_wait(&test_barrier); thr = odp_thread_id(); printf("Thread %i starts\n", thr); @@ -72,6 +75,7 @@ void shmem_test_odp_shm_sunnyday(void) if (thrdarg.numthrds > MAX_WORKERS) thrdarg.numthrds = MAX_WORKERS; + odp_barrier_init(&test_barrier, thrdarg.numthrds); odp_cunit_thread_create(run_shm_thread, &thrdarg); odp_cunit_thread_exit(&thrdarg); }