diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-06-03 15:47:01 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-06-03 16:07:20 -0500 |
commit | c1e6a6e6f33be966501aaca868c5f930b5712dca (patch) | |
tree | 894ffc161a44c83a64244f1e25ca04e32a540f0b /src/kernel/cpumgr.C | |
parent | 63c956fe6ab673da7b68bcdf12f03608cac368b1 (diff) | |
download | talos-hostboot-c1e6a6e6f33be966501aaca868c5f930b5712dca.tar.gz talos-hostboot-c1e6a6e6f33be966501aaca868c5f930b5712dca.zip |
Fix race condition in active cpu count.
Change-Id: I3a8a6a521d219a55600b3370fb75a25b8ed085be
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1154
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/cpumgr.C')
-rw-r--r-- | src/kernel/cpumgr.C | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C index f995eb543..3bb52b63c 100644 --- a/src/kernel/cpumgr.C +++ b/src/kernel/cpumgr.C @@ -1,25 +1,26 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/kernel/cpumgr.C $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2010 - 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG + * This is an automatically generated prolog. + * + * $Source: src/kernel/cpumgr.C $ + * + * IBM CONFIDENTIAL + * + * COPYRIGHT International Business Machines Corp. 2010-2012 + * + * p1 + * + * Object Code Only (OCO) source materials + * Licensed Internal Code Source Materials + * IBM HostBoot Licensed Internal Code + * + * The source code for this program is not published or other- + * wise divested of its trade secrets, irrespective of what has + * been deposited with the U.S. Copyright Office. + * + * Origin: 30 + * + * IBM_PROLOG_END_TAG + */ #include <assert.h> #include <kernel/cpumgr.H> #include <kernel/task.H> @@ -174,7 +175,7 @@ void CpuManager::startSlaveCPU(cpu_t* cpu) void CpuManager::activateCPU(cpu_t * i_cpu) { i_cpu->active = true; - ++cv_cpuCount; + __sync_fetch_and_add(&cv_cpuCount, 1); lwsync(); } |