For this test we use the MutexSemaphoreGroup and related type to emulate a double exchange example:
Thread 1 (main) : Performs the housekeeping and data source Thread 2 (child) : Is the data sink
Both threads have a control semaphore which the other thread uses to control access to a resource , in this case the the data counter gvalue. They are also used as a synchronization mechanism,
A third semaphore is used as a flag/signal to indicate that the threads should drop out of the source->sink loop.