Remove the unnecessary spin_lock protection around CoreUnloadImage. There is almost zero possibility for this reentrancy issue here. With this change, we also keep EDK 2 and EDK core's CoreUnloadImage consistent with each other.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5906 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qwang12 2008-09-17 02:20:24 +00:00
parent a04ad3f01f
commit 46fee0d7b6
1 changed files with 0 additions and 16 deletions

View File

@ -17,8 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
// Module Globals // Module Globals
// //
SPIN_LOCK mUnloadImageLock;
LOADED_IMAGE_PRIVATE_DATA *mCurrentImage = NULL; LOADED_IMAGE_PRIVATE_DATA *mCurrentImage = NULL;
LOAD_PE32_IMAGE_PRIVATE_DATA mLoadPe32PrivateData = { LOAD_PE32_IMAGE_PRIVATE_DATA mLoadPe32PrivateData = {
@ -139,11 +137,6 @@ CoreInitializeImageServices (
mCurrentImage = Image; mCurrentImage = Image;
//
// Initialize spin lock
//
InitializeSpinLock (&mUnloadImageLock);
// //
// Fill in DXE globals // Fill in DXE globals
// //
@ -1366,14 +1359,6 @@ CoreUnloadImage (
EFI_STATUS Status; EFI_STATUS Status;
LOADED_IMAGE_PRIVATE_DATA *Image; LOADED_IMAGE_PRIVATE_DATA *Image;
//
// Prevent possible reentrance to this function
// for the same ImageHandle
//
if (!AcquireSpinLockOrFail (&mUnloadImageLock)) {
return EFI_UNSUPPORTED;
}
Image = CoreLoadedImageInfo (ImageHandle); Image = CoreLoadedImageInfo (ImageHandle);
if (Image == NULL ) { if (Image == NULL ) {
// //
@ -1408,7 +1393,6 @@ CoreUnloadImage (
} }
Done: Done:
ReleaseSpinLock (&mUnloadImageLock);
return Status; return Status;
} }