diff options
Diffstat (limited to 'kern/mutex')
-rw-r--r-- | kern/mutex/mutex_adaptive.c | 4 | ||||
-rw-r--r-- | kern/mutex/mutex_adaptive_i.h | 6 | ||||
-rw-r--r-- | kern/mutex/mutex_plain_i.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/kern/mutex/mutex_adaptive.c b/kern/mutex/mutex_adaptive.c index db92f9d5..b2af4561 100644 --- a/kern/mutex/mutex_adaptive.c +++ b/kern/mutex/mutex_adaptive.c @@ -16,13 +16,13 @@ */ #include <assert.h> +#include <errno.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <kern/atomic.h> #include <kern/clock.h> -#include <kern/error.h> #include <kern/init.h> #include <kern/mutex.h> #include <kern/mutex_types.h> @@ -152,7 +152,7 @@ mutex_adaptive_lock_slow_common(struct mutex *mutex, bool timed, uint64_t ticks) mutex_adaptive_inc_sc(MUTEX_ADAPTIVE_SC_SPINS); if (timed && clock_time_occurred(ticks, clock_get_time())) { - error = ERROR_TIMEDOUT; + error = ETIMEDOUT; break; } diff --git a/kern/mutex/mutex_adaptive_i.h b/kern/mutex/mutex_adaptive_i.h index ce2ac4f2..05e97640 100644 --- a/kern/mutex/mutex_adaptive_i.h +++ b/kern/mutex/mutex_adaptive_i.h @@ -24,10 +24,10 @@ #endif #include <assert.h> +#include <errno.h> #include <stdint.h> #include <kern/atomic.h> -#include <kern/error.h> #include <kern/init.h> #include <kern/macros.h> #include <kern/mutex_types.h> @@ -58,7 +58,7 @@ mutex_adaptive_lock_fast(struct mutex *mutex) owner = atomic_cas_acquire(&mutex->owner, 0, (uintptr_t)thread_self()); if (unlikely(owner != 0)) { - return ERROR_BUSY; + return EBUSY; } return 0; @@ -72,7 +72,7 @@ mutex_adaptive_unlock_fast(struct mutex *mutex) owner = atomic_cas_release(&mutex->owner, (uintptr_t)thread_self(), 0); if (unlikely(owner & MUTEX_ADAPTIVE_CONTENDED)) { - return ERROR_BUSY; + return EBUSY; } return 0; diff --git a/kern/mutex/mutex_plain_i.h b/kern/mutex/mutex_plain_i.h index 0c58174b..d28fd92b 100644 --- a/kern/mutex/mutex_plain_i.h +++ b/kern/mutex/mutex_plain_i.h @@ -24,10 +24,10 @@ #endif #include <assert.h> +#include <errno.h> #include <stdint.h> #include <kern/atomic.h> -#include <kern/error.h> #include <kern/init.h> #include <kern/mutex_types.h> @@ -52,7 +52,7 @@ mutex_plain_lock_fast(struct mutex *mutex) state = atomic_cas_acquire(&mutex->state, MUTEX_UNLOCKED, MUTEX_LOCKED); if (unlikely(state != MUTEX_UNLOCKED)) { - return ERROR_BUSY; + return EBUSY; } return 0; @@ -66,7 +66,7 @@ mutex_plain_unlock_fast(struct mutex *mutex) state = atomic_swap_release(&mutex->state, MUTEX_UNLOCKED); if (unlikely(state == MUTEX_CONTENDED)) { - return ERROR_BUSY; + return EBUSY; } return 0; |