void vQueueDelete( xQueueHandle pxQueue ) { traceQUEUE_DELETE( pxQueue ); vQueueUnregisterQueue( pxQueue ); vPortFree( pxQueue->pcHead ); vPortFree( pxQueue ); }
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) { BaseType_t xRunningPrivileged = xPortRaisePrivilege(); vQueueUnregisterQueue( xQueue ); vPortResetPrivilege( xRunningPrivileged ); }
/* Called from vApplicationIdleHook(), which is defined in main.c. */ void vFullDemoIdleFunction( void ) { const unsigned long ulMSToSleep = 15; void *pvAllocated; /* Sleep to reduce CPU load, but don't sleep indefinitely in case there are tasks waiting to be terminated by the idle task. */ Sleep( ulMSToSleep ); /* Demonstrate a few utility functions that are not demonstrated by any of the standard demo tasks. */ prvDemonstrateTaskStateAndHandleGetFunctions(); /* Demonstrate the use of xTimerPendFunctionCall(), which is not demonstrated by any of the standard demo tasks. */ prvDemonstratePendingFunctionCall(); /* Demonstrate the use of functions that query information about a software timer. */ prvDemonstrateTimerQueryFunctions(); /* If xMutexToDelete has not already been deleted, then delete it now. This is done purely to demonstrate the use of, and test, the vSemaphoreDelete() macro. Care must be taken not to delete a semaphore that has tasks blocked on it. */ if( xMutexToDelete != NULL ) { /* For test purposes, add the mutex to the registry, then remove it again, before it is deleted - checking its name is as expected before and after the assertion into the registry and its removal from the registry. */ configASSERT( pcQueueGetName( xMutexToDelete ) == NULL ); vQueueAddToRegistry( xMutexToDelete, "Test_Mutex" ); configASSERT( strcmp( pcQueueGetName( xMutexToDelete ), "Test_Mutex" ) == 0 ); vQueueUnregisterQueue( xMutexToDelete ); configASSERT( pcQueueGetName( xMutexToDelete ) == NULL ); vSemaphoreDelete( xMutexToDelete ); xMutexToDelete = NULL; } /* Exercise heap_5 a bit. The malloc failed hook will trap failed allocations so there is no need to test here. */ pvAllocated = pvPortMalloc( ( rand() % 500 ) + 1 ); vPortFree( pvAllocated ); }
void AJ_QueueDelete(struct AJ_Queue* q) { vQueueUnregisterQueue(q->q); vQueueDelete(q->q); }