SAM function SAM-Memory-write-prepare()
SAM_Memory_write_prepare - Prepare a region of memory for writing
#include <sam.h> void SAM_Memory_write_prepare(SAM_t sam, void *addr);
The SAM_Memory_write_prepare() function flashes back all the worker threads that have speculatively read the region of memory in which the address addr is contained, and halts the ones that try to access it. The SAM_Memory_write_prepare() function needs a matching call to the function SAM_Memory_write() pointing to the same memory region as addr and within the same SAM Structure object sam context in order to resume the execution of the halted worker threads. This function shall only be called from the main execution thread.
 Return value
None, assumes correct input parameters.
Example 3 B - Executing speculatively and flashing back a worker thread (efficient version)
Example 4 - Executing speculatively, flashing back, and speculative writing
Example 5 - Using multiple protected memory regions within the same SAM context