Skip to content

Commit

Permalink
Fix intermittent Jenkins CI fail
Browse files Browse the repository at this point in the history
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 <ismirno@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Roland Veloz <rveloz@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Matt Raybuck authored and dcrowell77 committed Jan 10, 2019
1 parent 8c09e8b commit 1ba78c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/sync.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2011,2018 */
/* Contributors Listed Below - COPYRIGHT 2011,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1ba78c4

Please sign in to comment.