diff --git a/haiku_loader/loader_mutex.cpp b/haiku_loader/loader_mutex.cpp index 5c9b20f..549867a 100644 --- a/haiku_loader/loader_mutex.cpp +++ b/haiku_loader/loader_mutex.cpp @@ -34,7 +34,7 @@ static int32_t atomic_or(int32_t *a, int32_t b); static int32_t atomic_and(int32_t *a, int32_t b); static int loader_mutex_lock_locked(int32_t *mutex, const char *name, uint32_t flags, int64_t timeout, std::unique_lock &lock); -static void loader_mutex_unlock_locked(int32_t *mutex, uint32_t flags); +static void loader_mutex_unblock_locked(int32_t *mutex, uint32_t flags); static int loader_mutex_wait_locked(int32_t *mutex, const char *name, uint32_t flags, int64_t timeout, std::unique_lock &lock, bool &lastWaiter); static void add_loader_mutex_info(int32_t *mutex, std::shared_ptr info); @@ -60,7 +60,7 @@ int loader_mutex_lock(int32_t *mutex, const char *name, uint32_t flags, int64_t return error; } -int loader_mutex_unlock(int32_t *mutex, uint32 flags) +int loader_mutex_unblock(int32_t *mutex, uint32 flags) { if (mutex == NULL || ((intptr_t)mutex) % 4 != 0) { @@ -70,7 +70,7 @@ int loader_mutex_unlock(int32_t *mutex, uint32 flags) { auto lock = std::unique_lock(sMutexTableLock); - loader_mutex_unlock_locked(mutex, flags); + loader_mutex_unblock_locked(mutex, flags); } return B_OK; @@ -94,7 +94,7 @@ int loader_mutex_switch_lock(int32_t *fromMutex, int32_t *toMutex, // unlock the first mutex and lock the second one { auto lock = std::unique_lock(sMutexTableLock); - loader_mutex_unlock_locked(fromMutex, flags); + loader_mutex_unblock_locked(fromMutex, flags); error = loader_mutex_lock_locked(toMutex, name, flags, timeout, lock); } @@ -125,7 +125,7 @@ static int loader_mutex_lock_locked(int32_t *mutex, const char *name, uint32_t f return error; } -static void loader_mutex_unlock_locked(int32_t *mutex, uint32_t flags) +static void loader_mutex_unblock_locked(int32_t *mutex, uint32_t flags) { auto it = sMutexTable.find(mutex); if (it == sMutexTable.end() || !it->second || it->second->empty()) diff --git a/haiku_loader/loader_mutex.h b/haiku_loader/loader_mutex.h index 60bcbd1..f0ea280 100644 --- a/haiku_loader/loader_mutex.h +++ b/haiku_loader/loader_mutex.h @@ -4,7 +4,7 @@ #include int loader_mutex_lock(int32_t* mutex, const char* name, uint32_t flags, int64_t timeout); -int loader_mutex_unlock(int32_t* mutex, uint32_t flags); +int loader_mutex_unblock(int32_t* mutex, uint32_t flags); // Unlocks "from" and locks "to" such that unlocking and starting to wait // for the lock is atomic. I.e. if "from" guards the object "to" belongs // to, the operation is safe as long as "from" is held while destroying diff --git a/haiku_loader/sys/linux/loader_commpage.cpp b/haiku_loader/sys/linux/loader_commpage.cpp index 82fa59a..9f1cd6f 100644 --- a/haiku_loader/sys/linux/loader_commpage.cpp +++ b/haiku_loader/sys/linux/loader_commpage.cpp @@ -103,7 +103,7 @@ void* loader_allocate_commpage() hostcalls_ptr->wait_for_thread = loader_wait_for_thread; hostcalls_ptr->mutex_lock = loader_mutex_lock; - hostcalls_ptr->mutex_unlock = loader_mutex_unlock; + hostcalls_ptr->mutex_unblock = loader_mutex_unblock; hostcalls_ptr->mutex_switch_lock = loader_mutex_switch_lock; hostcalls_ptr->realtime_sem_open = loader_realtime_sem_open; diff --git a/monika/linux/threading.cpp b/monika/linux/threading.cpp index e7cae90..9f1cf74 100644 --- a/monika/linux/threading.cpp +++ b/monika/linux/threading.cpp @@ -111,9 +111,9 @@ status_t _moni_mutex_lock(int32* mutex, const char* name, return GET_HOSTCALLS()->mutex_lock(mutex, name, flags, timeout); } -status_t _moni_mutex_unlock(int32* mutex, uint32 flags) +status_t _moni_mutex_unblock(int32* mutex, uint32 flags) { - return GET_HOSTCALLS()->mutex_unlock(mutex, flags); + return GET_HOSTCALLS()->mutex_unblock(mutex, flags); } status_t _moni_mutex_switch_lock(int32* fromMutex, int32* toMutex, diff --git a/shared_headers/extended_commpage.h b/shared_headers/extended_commpage.h index b94b2fe..3bf468a 100644 --- a/shared_headers/extended_commpage.h +++ b/shared_headers/extended_commpage.h @@ -68,7 +68,7 @@ struct hostcalls // Mutex int (*mutex_lock)(int32_t* mutex, const char* name, uint32_t flags, int64_t timeout); - int (*mutex_unlock)(int32_t* mutex, uint32_t flags); + int (*mutex_unblock)(int32_t* mutex, uint32_t flags); int (*mutex_switch_lock)(int32_t* fromMutex, int32_t* toMutex, const char* name, uint32_t flags, int64_t timeout); // Semaphore diff --git a/shared_headers/user_mutex_defs.h b/shared_headers/user_mutex_defs.h index 3e1bf69..48d82e9 100644 --- a/shared_headers/user_mutex_defs.h +++ b/shared_headers/user_mutex_defs.h @@ -5,7 +5,7 @@ #ifndef _SYSTEM_USER_MUTEX_DEFS_H #define _SYSTEM_USER_MUTEX_DEFS_H -// user mutex specific flags passed to _kern_user_mutex_unlock() +// user mutex specific flags passed to _kern_user_mutex_unblock() #define B_USER_MUTEX_UNBLOCK_ALL 0x80000000 // All threads currently waiting on the mutex will be unblocked. The mutex // state will be locked.