Implemented geist's recent change to mutexes - they are now no longer

benaphores; benaphores aren't that beneficial in kernel land, the benaphores
are a way to reduce the number of kernel calls.
They can now only be released by the same thread who originally acquired it.

Included other changes geist (change 1499) did to a) fix some bugs, and
b) reflect the changes made to the mutexes.
Cleaned the files a bit up, all the commented dprintf()s in elf.c are now
deactivated through a macro.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@311 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-07-18 19:21:40 +00:00
parent 2b5d1dc418
commit 4bb2d8915b
5 changed files with 289 additions and 186 deletions
+6 -6
View File
@@ -2,6 +2,7 @@
** Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
*/
#include <Errors.h>
#include <kerrors.h>
#include <kernel.h>
@@ -1162,7 +1163,7 @@ static int dump_cache_ref(int argc, char **argv)
dprintf("cache_ref at %p:\n", cache_ref);
dprintf("cache: %p\n", cache_ref->cache);
dprintf("lock.count: %d\n", cache_ref->lock.count);
dprintf("lock.holder: %d\n", cache_ref->lock.holder);
dprintf("lock.sem: 0x%x\n", cache_ref->lock.sem);
dprintf("region_list:\n");
for(region = cache_ref->region_list; region != NULL; region = region->cache_next) {
@@ -1762,12 +1763,11 @@ int vm_init_postsem(kernel_args *ka)
// it isn't that hard to find all of the ones we need to create
vm_translation_map_module_init_post_sem(ka);
kernel_aspace->virtual_map.sem = create_sem(WRITE_COUNT, "kernel_aspacelock");
kernel_aspace->translation_map.lock.sem = create_sem(1, "recursive_lock");
recursive_lock_create(&kernel_aspace->translation_map.lock);
for(region = kernel_aspace->virtual_map.region_list; region; region = region->aspace_next) {
if(region->cache_ref->lock.sem < 0) {
region->cache_ref->lock.sem = create_sem(1, "cache_ref_mutex");
}
for (region = kernel_aspace->virtual_map.region_list; region; region = region->aspace_next) {
if (region->cache_ref->lock.sem < 0)
mutex_init(&region->cache_ref->lock, "cache_ref_mutex");
}
region_hash_sem = create_sem(WRITE_COUNT, "region_hash_sem");