Skip to content

Commit d037952

Browse files
zhuzhuzhusRbb666
authored andcommitted
smp
1 parent d8956e4 commit d037952

File tree

1 file changed

+3
-2
lines changed
  • components/drivers/smp

1 file changed

+3
-2
lines changed

components/drivers/smp/smp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void rt_smp_call_func_cond(int cpu_mask, rt_smp_call_func_back func, void *data,
7171
int cpuid = 1 << cur_cpu;
7272
int tmp_id = 0, cpu_nr = 0;
7373
int tmp_mask;
74+
int irq_flag;
7475

7576
if (flag == SMP_CALL_WAIT_ALL)
7677
{
@@ -101,9 +102,9 @@ void rt_smp_call_func_cond(int cpu_mask, rt_smp_call_func_back func, void *data,
101102
event.func = func;
102103
event.data = data;
103104
event.cpu_mask = cpu_mask;
104-
rt_spin_lock(&rt_smp_work[tmp_id].lock);
105+
irq_flag = rt_spin_lock_irqsave(&rt_smp_work[tmp_id].lock);
105106
rt_smp_work[tmp_id].event = event;
106-
rt_spin_unlock(&rt_smp_work[tmp_id].lock);
107+
rt_spin_unlock_irqrestore(&rt_smp_work[tmp_id].lock,irq_flag);
107108
}
108109
tmp_id++;
109110
tmp_mask = tmp_mask >> 1;

0 commit comments

Comments
 (0)