This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/AM3358: GateMutexPri preempting

Part Number: AM3358


Tool/software: TI-RTOS

Good afternoon,

I am trying to get to grips with GateMutexPri module for securing single access to the flash interface on our device.  I think I have it roughly setup correctly and am ready to go but just have one query I cannot find the answer to any where else.

Because this is blocking access to the flash interface I only want one thread to have the gate at once but it appears to allow preemption and blocking at the same time which is what confuses me?

If it is blocking how can it also allow preemption?

I am using the query function to check the qualities of the gate as follows:

	if(GateMutexPri_query(GateMutexPri_Q_BLOCKING) == true)
		UARTPuts("GateMutex is blocking\r\n", -1);
	else
		UARTPuts("GateMutex isnt blocking\r\n", -1);
	if(GateMutexPri_query(GateMutexPri_Q_PREEMPTING) == true)
		UARTPuts("GateMutex is preempting\r\n", -1);
	else
		UARTPuts("GateMutex isnt preempting\r\n", -1);

and it says the gate has them both, how does this work and how can i stop preemption as I do not want anything preempting threads currently accessing the flash to access it themselves until the thread currently accessing it has finished.

Many thanks

Sean