]> granicus.if.org Git - esp-idf/commitdiff
Spinlocks already come initialized. Remove the code that would essentially re-initial...
authorJeroen Domburg <git@j0h.nl>
Fri, 23 Sep 2016 09:46:16 +0000 (17:46 +0800)
committerJeroen Domburg <git@j0h.nl>
Fri, 23 Sep 2016 09:46:16 +0000 (17:46 +0800)
components/freertos/tasks.c

index ff3a0530d65c3514528970487af06069489f69b7..b9035bda0f34d1b93c5a9c538123d141ce0c2a20 100644 (file)
@@ -275,9 +275,7 @@ when the scheduler is unsuspended.  The pending ready list itself can only be
 accessed from a critical section. */
 PRIVILEGED_DATA static volatile UBaseType_t uxSchedulerSuspended[ portNUM_PROCESSORS ] = { ( UBaseType_t ) pdFALSE };
 
-/* Muxes used in the task code */
-PRIVILEGED_DATA static portBASE_TYPE xMutexesInitialised = pdFALSE;
-/* For now, we use just one mux for all the critical sections. ToDo: give evrything a bit more granularity;
+/* For now, we use just one mux for all the critical sections. ToDo: give everything a bit more granularity;
   that could improve performance by not needlessly spinning in spinlocks for unrelated resources. */
 PRIVILEGED_DATA static portMUX_TYPE xTaskQueueMutex = portMUX_INITIALIZER_UNLOCKED;
 PRIVILEGED_DATA static portMUX_TYPE xTickCountMutex = portMUX_INITIALIZER_UNLOCKED;
@@ -577,15 +575,6 @@ static void prvResetNextTaskUnblockTime( void );
 
 #endif
 
-/*-----------------------------------------------------------*/
-
-
-static void vTaskInitializeLocalMuxes( void )
-{
-       vPortCPUInitializeMutex(&xTaskQueueMutex);
-       vPortCPUInitializeMutex(&xTickCountMutex);
-       xMutexesInitialised = pdTRUE;
-}
 
 /*-----------------------------------------------------------*/
 
@@ -596,9 +585,6 @@ TCB_t * pxNewTCB;
 StackType_t *pxTopOfStack;
 BaseType_t i;
        
-       /* Initialize mutexes, if they're not already initialized. */
-       if (xMutexesInitialised == pdFALSE) vTaskInitializeLocalMuxes();
-       
        configASSERT( pxTaskCode );
        configASSERT( ( ( uxPriority & ( ~portPRIVILEGE_BIT ) ) < configMAX_PRIORITIES ) );
        configASSERT( (xCoreID>=0 && xCoreID<portNUM_PROCESSORS) || (xCoreID==tskNO_AFFINITY) );
@@ -1725,10 +1711,6 @@ BaseType_t xAlreadyYielded = pdFALSE;
        scheduler has been resumed it is safe to move all the pending ready
        tasks from this list into their appropriate ready list. */
 
-       //This uses a mux, but can be called before tasks are scheduled. Make sure muxes are inited.
-       /* Initialize mutexes, if they're not already initialized. */
-       if (xMutexesInitialised == pdFALSE) vTaskInitializeLocalMuxes();
-
        taskENTER_CRITICAL(&xTaskQueueMutex);
        {
                --uxSchedulerSuspended[ xPortGetCoreID() ];