]> git.proxmox.com Git - mirror_edk2.git/commit
MdePkg/BaseSynchronizationLib: Do not check timeout if lock released
authorJeff Fan <jeff.fan@intel.com>
Mon, 21 Mar 2016 05:26:46 +0000 (13:26 +0800)
committerJeff Fan <jeff.fan@intel.com>
Tue, 5 Apr 2016 06:07:15 +0000 (14:07 +0800)
commit0f18e1eda2a807283484adfbf5eaae6a92b1ffa7
tree29a8f04d377253ec784a12dfc81b44ad3ce69f11
parentcfaaf99bdd412139ca7b9724e678429b2f2fb45f
MdePkg/BaseSynchronizationLib: Do not check timeout if lock released

Current AcquireSpinLock() will check if timeout happens when PcdSpinLockTimeout
is not zero, even though the spin lock is already released. It may do
unnecessary operation to read timer's counter. This update is trying to acquire
spin lock firstly. If it could be acquired successfully, needn't to check
timeout at all.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Library/BaseSynchronizationLib/Synchronization.c
MdePkg/Library/BaseSynchronizationLib/SynchronizationGcc.c
MdePkg/Library/BaseSynchronizationLib/SynchronizationMsc.c