+ /* Return the job to the task pool's job cache. */\r
+ IotTaskPool_RecycleJob( NULL, xJob );\r
+\r
+ /* Create a recycleable job again using the handle of this task as the job's\r
+ * context and the function that sends a notification to the task handle as\r
+ * the job's callback function. In the full task pool implementation the\r
+ * first parameter is used to pass the handle of the task pool this\r
+ * recyclable job is to be associated with. In the lean implementation of\r
+ * the task pool used by this demo there is only one task pool (the system\r
+ * task pool created within the task pool library) so the first parameter is\r
+ * NULL. */\r
+ xResult = IotTaskPool_CreateRecyclableJob( NULL,\r
+ prvSimpleTaskNotifyCallback,\r
+ (void * ) xTaskGetCurrentTaskHandle(),\r
+ &( xJobRecycled ) );\r
+ configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
+\r
+ /* Since this time the task pool's job cache had a recycleable job, it must\r
+ * have been re-used. Thefore expect the free heap space to be same as after\r
+ * the creation of first job */\r
+ configASSERT( xPortGetFreeHeapSize() == xFreeHeapAfterCreatingJob );\r
+\r
+ /* Expect the task pool to re-use the job in its cache as opposed to\r
+ * allocating a new one. */\r
+ configASSERT( xJobRecycled == xJob );\r
+\r
+ /* In the full task pool implementation the first parameter is used to\r
+ * pass the handle of the task pool to schedule. The lean task pool\r
+ * implementation used in this demo only supports a single task pool, which\r
+ * is created internally within the library, so the first parameter is NULL. */\r
+ xResult = IotTaskPool_Schedule( NULL, xJobRecycled, ulNoFlags );\r
+ configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
+\r
+ /* The priority of the task pool task(s) is higher than the priority\r
+ * of this task, so the job's callback function should have already\r
+ * executed, sending a notification to this task, and incrementing this\r
+ * task's notification value. */\r
+ xTaskNotifyWait( 0UL, /* Don't clear any bits on entry. */\r
+ 0UL, /* Don't clear any bits on exit. */\r
+ &ulNotificationValue, /* Obtain the notification value. */\r
+ xNoDelay ); /* No block time, return immediately. */\r
+ configASSERT( ulNotificationValue == 2 );\r
+\r
+ /* The job's callback has executed so the job is now completed. */\r
+ IotTaskPool_GetStatus( NULL, xJobRecycled, &xJobStatus );\r
+ configASSERT( xJobStatus == IOT_TASKPOOL_STATUS_COMPLETED );\r
+\r
+ /* Clean up the recyclable job. In the full implementation of the task\r
+ * pool the first parameter is used to pass a handle to the task pool the job\r
+ * is associated with. In the lean implementation of the task pool used by\r
+ * this demo there is only one task pool (the system task pool created in the\r
+ * task pool library itself) so the first parameter is NULL. */\r
+ xResult = IotTaskPool_DestroyRecyclableJob( NULL, xJobRecycled );\r
+ configASSERT( xResult == IOT_TASKPOOL_SUCCESS );\r
+\r
+ /* Clear all the notification value bits ready for the next example. */\r