From patchwork Thu Oct 29 18:34:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Fischofer X-Patchwork-Id: 55795 Delivered-To: patch@linaro.org Received: by 10.112.61.134 with SMTP id p6csp724739lbr; Thu, 29 Oct 2015 11:34:38 -0700 (PDT) X-Received: by 10.107.12.142 with SMTP id 14mr4976374iom.78.1446143678584; Thu, 29 Oct 2015 11:34:38 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 96si4350685iom.28.2015.10.29.11.34.37; Thu, 29 Oct 2015 11:34:38 -0700 (PDT) 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.20150623.gappssmtp.com Received: by lists.linaro.org (Postfix, from userid 109) id AAF3562C1A; Thu, 29 Oct 2015 18:34:37 +0000 (UTC) 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 511D762028; Thu, 29 Oct 2015 18:34:33 +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 7DD2B62C10; Thu, 29 Oct 2015 18:34:30 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by lists.linaro.org (Postfix) with ESMTPS id 68DEB62023 for ; Thu, 29 Oct 2015 18:34:29 +0000 (UTC) Received: by obcqt19 with SMTP id qt19so24763347obc.3 for ; Thu, 29 Oct 2015 11:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=SCCPSWPsY5BM6iDfABW9/bZiFY08uAaNSCcAbKYi56E=; b=wZxhgk7PCqHUFaU7JkVhqPKhFSPpYtjoEbb9QP7Svvyjf9fw2fd/eeLoZIqvDafage lwVQgaFsMPE07n2C8GeQDIx/GaK6Wnv7NOGuBjbecPfBw/2HxUtqtWUgfHcEDt0OM2Yc 8mttHtH+td1RVgSeklw0LIgi8JhvEPAJU/DJaX6P6b7zg5zDeFctwC+FiK38MDPOAa/R 0pnMlNHP9wVfQxvowxmRZsNVT98xcKDyQFNrGYlTYSHPfZhB/JPRiqMdUBp9itnGE15T K0uCJvbE65sIpqDEcrrn3cSvmGuER1sMLwm7OXtHvLd952bR1qikVoYuacVFhCZ6JleE ly0A== 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=SCCPSWPsY5BM6iDfABW9/bZiFY08uAaNSCcAbKYi56E=; b=FY28+/Qx+N0SilOujFB2Ncn/Msrk0V1+BJ2O6pQkRhMvgm1QaC0tIo8+RJHOwVgm/z 4WYxG5LOXD39uJdtf8g9u8fugPrBQ5iubZK29FtKrlfH3SaJTPfDgggzy5kizR+mWI/p Xgp96ZgQnD+Rcy3aKrElOCP9/UTwfmzJoxk1md2Ff00XkNwH7X2HdmCRo2b3HRFM9mIX lzzJo7rN0bfBvvj4YZnlzq6xluEAABXeyvStvdy/zNzvKkzGp0E7k+1pJwutytJN5uE2 /iMAol+zIUw2517pvgkYTD8mbrOH4GBIfXxxHIerlpuVL4u5tHO+AqoJfBZmaw4B1AUM +XQQ== X-Gm-Message-State: ALoCoQnR+PQJ2VbSzesnBWkOFLlu8i0NOcI8wxPwOJfTD/nzBwrYLNR569/F8gzMbHhn8bqJMiwz X-Received: by 10.60.227.131 with SMTP id sa3mr2393937oec.25.1446143668851; Thu, 29 Oct 2015 11:34:28 -0700 (PDT) Received: from Ubuntu15.localdomain (cpe-66-68-129-43.austin.res.rr.com. [66.68.129.43]) by smtp.gmail.com with ESMTPSA id my2sm1042791obb.17.2015.10.29.11.34.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 11:34:28 -0700 (PDT) From: Bill Fischofer To: lng-odp@lists.linaro.org, maxim.uvarov@linaro.org, mike.holmes@linaro.org Date: Thu, 29 Oct 2015 13:34:22 -0500 Message-Id: <1446143663-3781-1-git-send-email-bill.fischofer@linaro.org> X-Mailer: git-send-email 2.1.4 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCH 1/2] validation: synchronizers: add missing rwlock read lock functional test 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" rwlock functional tests test for write locks, however they should also test for read locks. Signed-off-by: Bill Fischofer --- test/validation/synchronizers/synchronizers.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/validation/synchronizers/synchronizers.c b/test/validation/synchronizers/synchronizers.c index 2406c77..6a8d79f 100644 --- a/test/validation/synchronizers/synchronizers.c +++ b/test/validation/synchronizers/synchronizers.c @@ -652,6 +652,19 @@ static void *rwlock_functional_test(void *arg UNUSED) lock_owner_delay = BASE_DELAY; for (cnt = 1; cnt <= iterations; cnt++) { + /* Verify that we can obtain a read lock */ + odp_rwlock_read_lock(&global_mem->global_rwlock); + + /* Verify lock is unowned (no writer holds it) */ + thread_delay(per_thread_mem, lock_owner_delay); + if (global_mem->global_lock_owner != 0) { + current_errs++; + sync_failures++; + } + + /* Release the read lock */ + odp_rwlock_read_unlock(&global_mem->global_rwlock); + /* Acquire the shared global lock */ odp_rwlock_write_lock(&global_mem->global_rwlock);