aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-03-18 20:01:51 -0700
committerChristian Cunningham <cc@localhost>2022-03-18 20:01:51 -0700
commit7368140be0e17f19300b53c5df77cf18aab45cff (patch)
tree7313cc20d49a03be8cb75803c10c553d70622172 /src
parentc0dab6412df6301802730c871b18583b4cfdcb76 (diff)
Fixed Mutex Deletion Logic
Diffstat (limited to 'src')
-rw-r--r--src/util/mutex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/mutex.c b/src/util/mutex.c
index 802558e..0525a3e 100644
--- a/src/util/mutex.c
+++ b/src/util/mutex.c
@@ -10,7 +10,7 @@ void mutex_init(void)
mutexs[m].addr = 0;
mutex_entries[m].value = &mutexs[m];
mutex_entries[m].entry_type = VALUE_ENTRY;
- mutex_entries[m].next = &mutex_entries[(m+1)%MAX_MUTEXS];
+ mutex_entries[m].next = &mutex_entries[m+1];
}
// Initialize Free Mutexs
mutex_manager.free.start.value = 0;
@@ -47,9 +47,9 @@ unsigned char delete_mutex(struct Mutex* m)
if (entry == 0)
return 1;
// Remove it from the queue
- remove_next_from_queue(entry);
+ struct Entry* theentry = remove_next_from_queue(entry);
// Add it to the free queue
- prepend_to_queue(entry, &mutex_manager.free);
+ prepend_to_queue(theentry, &mutex_manager.free);
return 0;
}