SAM function SAM-Execution-join()
SAM_Execution_join - Join the execution of a worker thread
#include <sam.h> void * SAM_Execution_join(SAM_t sam, SAM_Workerid_t wid);
The SAM_Execution_join() function suspends execution of the calling thread until the target worker thread terminates, unless the target worker thread has already terminated. When a SAM_Execution_join() returns successfully, the target worker thread has been terminated. The results of multiple simultaneous calls to SAM_Execution_join() specifying the same target worker thread within the same SAM Structure object sam are undefined. If the thread calling SAM_Execution_join() is canceled, then the worker threads will not be detached.
 Return value
On return from SAM_Execution_join() call, the value returned by the terminating worker thread is returned by SAM_Execution_join().
None, assumes correct input parameters.
Example 1 - Creating a basic worker thread
Example 2 - Sending and retrieving information to worker threads
Example 3 A - Executing speculatively and flashing back a worker thread (inefficient version)
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