Цитата(сарматъ @ Aug 29 2013, 12:12)

а если подобные конструкции будут в паралельных задачах они друг друга путать не будут?
Параллельные задачи - это же просто метафора. Реально в каждый момент времени выполняется одна задача. Любая другая задача по отношению к данной - это как прерывание. Короче, всё будет работать как надо

Цитата(сарматъ @ Aug 29 2013, 12:12)

где об этом можно прочитать?
Вот тут. Более развёрнутое объяснение от Joseph Yiu (
отсюда) :
Цитата
On some processors, the disable interrupt function might take sometime to take effect. This is because the masking is done via control register accesses through the bus. (there could be wait state on the bus and the write operation could be buffered, and the interrupt controller might need a cycle to update to the new setting).
On Cortex-M3, the interrupt mask registers are inside the processors (e.g. FAULTMASK, PRIMASK). As soon as PRIMASK/FAULTMASK/BASEPRI is set, the effect come immediately. So if you set the PRIMASK and the interrupt arrived at the same time, the interrupt will have to wait until the mask is cleared. To do this, the interrupt mask registers are accessible by CPS, MSR and MRS instructions only
Короче, виснет не из-за этого.
Если бы я знал, что такое электричество...