* Initialize all static mutexes in the kernel through a MUTEX_INITIALIZER()

and remove the then unneeded mutex_init() for them.
* Remove the workaround for allowing uninitialized mutexes on kernel startup.
  As they are all initialized statically through the MUTEX_INITIALIZER() now
  this is not needed anymore.
* An uninitialized mutex will now cause a panic when used to find possibly
  remaining cases.
* Remove now unnecessary driver_settings_init_post_sem() function.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25812 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-06-05 23:19:27 +00:00
parent 2b31f85c9e
commit f5b3a6a796
16 changed files with 32 additions and 66 deletions
+5 -6
View File
@@ -59,9 +59,11 @@ typedef struct elf_linked_image {
static hash_table *sImagesHash;
static struct elf_image_info *sKernelImage = NULL;
static mutex sImageMutex; // guards sImagesHash
static mutex sImageLoadMutex; // serializes loading/unloading add-ons
// locking order sImageLoadMutex -> sImageMutex
static mutex sImageMutex = MUTEX_INITIALIZER("kimages_lock");
// guards sImagesHash
static mutex sImageLoadMutex = MUTEX_INITIALIZER("kimages_load_lock");
// serializes loading/unloading add-ons locking order
// sImageLoadMutex -> sImageMutex
static bool sInitialized = false;
@@ -1785,9 +1787,6 @@ elf_init(kernel_args *args)
image_init();
mutex_init(&sImageMutex, "kimages_lock");
mutex_init(&sImageLoadMutex, "kimages_load_lock");
sImagesHash = hash_init(IMAGE_HASH_SIZE, 0, image_compare, image_hash);
if (sImagesHash == NULL)
return B_NO_MEMORY;