mutex_init: remove force inline

This commit is contained in:
anna 2021-08-10 17:48:53 +02:00
parent fb49965e95
commit 4287759c46
Signed by: fef
GPG key ID: EC22E476DC2D3D84
2 changed files with 8 additions and 5 deletions

View file

@ -97,11 +97,7 @@ extern void _mutex_unlock(uint8_t *lock);
*
* @param mutex Mutex to initialize
*/
__always_inline void mutex_init(struct mutex *mutex)
{
mutex->lock = 0;
list_init(&mutex->wait_queue);
}
void mutex_init(struct mutex *mutex);
/**
* @brief Acquire an exclusive lock on a mutex.

View file

@ -10,6 +10,13 @@
#include <errno.h>
#include <stddef.h>
void mutex_init(struct mutex *mutex)
{
mutex->lock = 0;
spin_init(&mutex->wait_queue_lock);
list_init(&mutex->wait_queue);
}
void mutex_lock(struct mutex *mutex)
{
if (mutex_trylock(mutex) != 0) {