diff --git a/include/etl/mutex/mutex_gcc_sync.h b/include/etl/mutex/mutex_gcc_sync.h index 7e909ab1..298497c0 100644 --- a/include/etl/mutex/mutex_gcc_sync.h +++ b/include/etl/mutex/mutex_gcc_sync.h @@ -61,7 +61,7 @@ namespace etl bool try_lock() { - return (__sync_lock_test_and_set(&flag, 1U) == 1U); + return (__sync_lock_test_and_set(&flag, 1U) == 0U); } void unlock()