Skip to content

Commit dd19c0e

Browse files
Tm-C-mTRbb666
authored andcommitted
[utest]: Solve the address misalignment issue of atomic operations
In smp_assigned_idle_cores_tc, the finish_flag involves atomic operations and thus requires address alignment. Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
1 parent 7836d26 commit dd19c0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/utest/smp/smp_assigned_idle_cores_tc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE
5050
#define THREAD_PRIORITY 20
5151
static rt_thread_t threads[RT_CPUS_NR - 1];
52-
static int tick = 0, finish_flag = 0;
52+
static int tick = 0;
53+
static rt_align(sizeof(rt_ubase_t)) int finish_flag = 0;
5354
static int num = 0;
5455
/* thread entry function */
5556
static void thread_entry(void *parameter)

0 commit comments

Comments
 (0)