From b6b25a9e68f2c34fe9cb5b69fc802b4b9f25d53b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 29 Jun 2016 15:32:51 +0200 Subject: score: Fix thread lock on SMP configurations --- cpukit/score/include/rtems/score/thread.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cpukit/score/include/rtems/score/thread.h') diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 4d498e5f3f..46c222ff52 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -666,7 +666,19 @@ typedef struct { * of the actual RTEMS build configuration, e.g. profiling enabled or * disabled. */ - SMP_ticket_lock_Control *current; + union { + /** + * @brief The current thread lock as an atomic unsigned integer pointer value. + */ + Atomic_Uintptr atomic; + + /** + * @brief The current thread lock as a normal pointer. + * + * Only provided for debugging purposes. + */ + SMP_ticket_lock_Control *normal; + } current; /** * @brief The default thread lock in case the thread is not blocked on a @@ -680,7 +692,7 @@ typedef struct { * * These statistics are used by the executing thread in case it acquires a * thread lock. Thus the statistics are an aggregation of acquire and - * release operations of diffent locks. + * release operations of different locks. */ SMP_lock_Stats Stats; #endif -- cgit v1.2.3