Mutex type semaphores should be acquired and released by the same task. Add a check to xQueueGenericSend for this condition.