diff options
| author | Shell <[email protected]> | 2024-04-19 11:27:30 +0800 |
|---|---|---|
| committer | Meco Man <[email protected]> | 2024-04-19 21:30:12 -0400 |
| commit | 8c4db32d041153abab4484ac4118b147cf40fe32 (patch) | |
| tree | 7fbe84eb2e3b5ef23932bccb540620755ecdb1d2 /include | |
| parent | 451ac0396512d9fbf2ccad48e08774b8da3cb5ac (diff) | |
fixup: debug
Diffstat (limited to 'include')
| -rw-r--r-- | include/rttypes.h | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/include/rttypes.h b/include/rttypes.h index bfd6d7975e..f082fa0b61 100644 --- a/include/rttypes.h +++ b/include/rttypes.h @@ -180,19 +180,15 @@ struct rt_spinlock #else /* !RT_DEBUGING_SPINLOCK */ - #define _SPIN_LOCK_DEBUG_OWNER(lock) - #define _SPIN_UNLOCK_DEBUG_OWNER(lock) + #define _SPIN_LOCK_DEBUG_OWNER(lock) RT_UNUSED(lock) + #define _SPIN_UNLOCK_DEBUG_OWNER(lock) RT_UNUSED(lock) #endif /* RT_DEBUGING_SPINLOCK */ #ifdef RT_USING_DEBUG - #define _SPIN_LOCK_DEBUG_CRITICAL(lock) \ - do \ - { \ - struct rt_thread *_curthr = rt_thread_self(); \ - if (_curthr != RT_NULL) \ - { \ - (lock)->critical_level = rt_critical_level(); \ - } \ + #define _SPIN_LOCK_DEBUG_CRITICAL(lock) \ + do \ + { \ + (lock)->critical_level = rt_critical_level(); \ } while (0) #define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) \ @@ -202,8 +198,8 @@ struct rt_spinlock } while (0) #else /* !RT_USING_DEBUG */ - #define _SPIN_LOCK_DEBUG_CRITICAL(lock) - #define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) (critical = 0) + #define _SPIN_LOCK_DEBUG_CRITICAL(lock) RT_UNUSED(lock) + #define _SPIN_UNLOCK_DEBUG_CRITICAL(lock, critical) do {critical = 0; RT_UNUSED(lock);} while (0) #endif /* RT_USING_DEBUG */ |
