Synchronizing tasks

Hope I can make it clearer:

Task1 is waiting to receive a character in the input queue- As soon as the character is available, it puts it in the output queue and flags that a character has been received. It does this by setting the flag sem1.

Task2’s sheere obligation is, to watch whether sem1 is set, toggle the LED once and reset sem1.