xError = pdTRUE;\r
}\r
\r
+ /* Try a synch with no other tasks involved. First set all the bits other\r
+ than this task's bit. */\r
+ xEventGroupSetBits( xEventGroup, ( ebALL_SYNC_BITS & ~ebSET_BIT_TASK_SYNC_BIT ) );\r
+\r
+ /* Then wait on just one bit - the bit that is being set. */\r
+ uxBits = xEventGroupSync( xEventGroup, /* The event group used for the synchronisation. */\r
+ ebSET_BIT_TASK_SYNC_BIT,/* The bit set by this task when it reaches the sync point. */\r
+ ebSET_BIT_TASK_SYNC_BIT,/* The bits to wait for - in this case it is just waiting for itself. */\r
+ portMAX_DELAY ); /* The maximum time to wait for the sync condition to be met. */\r
+\r
+ /* A sync with a max delay should only exit when all the synchronise\r
+ bits are set...check that is the case. In this case there is only one\r
+ sync bit anyway. */\r
+ if( ( uxBits & ebSET_BIT_TASK_SYNC_BIT ) != ebSET_BIT_TASK_SYNC_BIT )\r
+ {\r
+ xError = pdTRUE;\r
+ }\r
+\r
+ /* ...but now the sync bits should be clear again, leaving all the other\r
+ bits set (as only one bit was being waited for). */\r
+ if( xEventGroupGetBits( xEventGroup ) != ( ebALL_SYNC_BITS & ~ebSET_BIT_TASK_SYNC_BIT ) )\r
+ {\r
+ xError = pdTRUE;\r
+ }\r
+\r
+ /* Clear all the bits to zero again. */\r
+ xEventGroupClearBits( xEventGroup, ( ebALL_SYNC_BITS & ~ebSET_BIT_TASK_SYNC_BIT ) );\r
+ if( xEventGroupGetBits( xEventGroup ) != 0 )\r
+ {\r
+ xError = pdTRUE;\r
+ }\r
+\r
/* Unsuspend the other tasks then check they have executed up to the\r
synchronisation point. */\r
vTaskResume( xTestSlaveTaskHandle );\r
\r
/* Rendezvous always clear the bits. They will have been cleared\r
already unless this is the only task in the rendezvous. */\r
- pxEventBits->uxEventBits &= uxBitsToWaitFor;\r
+ pxEventBits->uxEventBits &= ~uxBitsToWaitFor;\r
\r
xTicksToWait = 0;\r
}\r
{\r
/* Reset the next expected unblock time in case it referred to\r
the task that has just been deleted. */\r
- prvResetNextTaskUnblockTime();\r
+ taskENTER_CRITICAL();\r
+ {\r
+ prvResetNextTaskUnblockTime();\r
+ }\r
+ taskEXIT_CRITICAL();\r
}\r
}\r
}\r
/* A task other than the currently running task was suspended,\r
reset the next expected unblock time in case it referred to the\r
task that is now in the Suspended state. */\r
- prvResetNextTaskUnblockTime();\r
+ taskENTER_CRITICAL();\r
+ {\r
+ prvResetNextTaskUnblockTime();\r
+ }\r
+ taskEXIT_CRITICAL();\r
}\r
else\r
{\r