From 1ba78c4580b6067882d62909c2ce2941ad36008d Mon Sep 17 00:00:00 2001 From: Matt Raybuck Date: Wed, 9 Jan 2019 14:41:16 -0600 Subject: Fix intermittent Jenkins CI fail There is an intermittent CI fail where test case modules will time out due to an assert in sync.C. This will prevent the assert from occuring if too many calls to mutex unlock are made. Change-Id: Iff90cc31a4faefa4eeef8d0675b804bec0f2a7d2 CQ:SW453293 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/70265 Reviewed-by: Ilya Smirnov Reviewed-by: Michael Baiocchi Reviewed-by: Roland Veloz Reviewed-by: Nicholas E. Bofferding Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/lib/sync.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/sync.C b/src/lib/sync.C index 210790074..420fb3416 100644 --- a/src/lib/sync.C +++ b/src/lib/sync.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2018 */ +/* Contributors Listed Below - COPYRIGHT 2011,2019 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -243,7 +243,7 @@ void mutex_unlock(mutex_t * i_mutex) uint64_t l_lockStatus = __sync_fetch_and_sub(&(i_mutex->iv_val), 1); - if(unlikely(l_lockStatus == 2)) + if(unlikely(l_lockStatus >= 2)) { // Fully release the lock and let another task grab it. i_mutex->iv_val = 0; @@ -351,7 +351,7 @@ void recursive_mutex_unlock(mutex_t * i_mutex) // to l_lockStatus. l_lockStatus = __sync_fetch_and_sub(&(i_mutex->iv_val),1); - if(unlikely(l_lockStatus == 2)) + if(unlikely(l_lockStatus >= 2)) { // Fully release the lock to allow the next task to grab it. i_mutex->iv_val = 0; -- cgit v1.2.1