Hello Ashi Gupta,
I need a little more information about what you need. According you mention I can suggest to use a mutex or semaphore.
A mutex provides mutual exclusion among tasks, when they access a shared resource. Mutexes are strict; that is, a task cannot unlock a mutex, unless it had first locked the mutex.
In addition you can use semaphores to synchronize tasks. You can use a semaphore to guard access to a shared resource, or to implement a producer/consumer-signalling mechanism. Semaphores can be strict or non-strict. There are named and fast semaphores.
You can find mutex and semaphore examples at the path: C:\Freescale\Freescale_MQX_4_2\mqx\examples
In addition you can check the below training documents
Training Class: MQX RTOS v4.1 Basics Training for MQX Beginners
I hope this helps,
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------