I have a struct
that I have to copy; that does not present any problem, unless during the copy activates an interruption, and the handle function modify the data of that struct
.
In principle, there would be no problem. We protect data through calls to
atomic_flag_test_and_set( );
If we were in a multithread environment, we could do a thrd_yield( );
, ceding the CPU to another process as long as we can not access the protected data.
But, what if we are in an interrupt handler? Here we can not do a thrd_yield( );
The question, then, is the following:
How to wait, within an interruption management function, to that a resource is free, without returning to re-launch the interruption?