]> git.sur5r.net Git - freertos/commitdiff
Change the way the critical sections are handled within interrupts so the critical...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 19 May 2008 19:16:57 +0000 (19:16 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 19 May 2008 19:16:57 +0000 (19:16 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@361 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/queue.c

index b31893d3373f9856b5c881f9bd8722427178f538..b7ef66f2c3e5b515308d1df570722fb39ba91e48 100644 (file)
@@ -690,9 +690,7 @@ xTimeOutType xTimeOut;
                                                        {\r
                                                                if( pxQueue->uxQueueType == queueQUEUE_IS_MUTEX )\r
                                                                {\r
-                                                                       portENTER_CRITICAL();\r
-                                                                               vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
-                                                                       portEXIT_CRITICAL();\r
+                                                                       vTaskPriorityInherit( ( void * ) pxQueue->pxMutexHolder );\r
                                                                }\r
                                                        }\r
                                                        #endif\r
@@ -802,13 +800,14 @@ xTimeOutType xTimeOut;
 signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition )\r
 {\r
 signed portBASE_TYPE xReturn;\r
+unsigned portBASE_TYPE uxSavedInterruptStatus;\r
 \r
        /* Similar to xQueueGenericSend, except we don't block if there is no room\r
        in the queue.  Also we don't directly wake a task that was blocked on a\r
        queue read, instead we return a flag to say whether a context switch is\r
        required or not (i.e. has a task with a higher priority than us been woken\r
        by this post). */\r
-       portSET_INTERRUPT_MASK_FROM_ISR();\r
+       uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
                if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )\r
                {\r
@@ -845,7 +844,7 @@ signed portBASE_TYPE xReturn;
                        xReturn = errQUEUE_FULL;\r
                }\r
        }\r
-       portCLEAR_INTERRUPT_MASK_FROM_ISR();\r
+       portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
 \r
        return xReturn;\r
 }\r
@@ -1007,8 +1006,9 @@ signed portCHAR *pcOriginalReadPosition;
 signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxTaskWoken )\r
 {\r
 signed portBASE_TYPE xReturn;\r
+unsigned portBASE_TYPE uxSavedInterruptStatus;\r
 \r
-       portSET_INTERRUPT_MASK_FROM_ISR();\r
+       uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
        {\r
                /* We cannot block from an ISR, so check there is data available. */\r
                if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )\r
@@ -1048,7 +1048,7 @@ signed portBASE_TYPE xReturn;
                        traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue );\r
                }\r
        }\r
-       portCLEAR_INTERRUPT_MASK_FROM_ISR();\r
+       portCLEAR_INTERRUPT_MASK_FROM_ISR( uxSavedInterruptStatus );\r
 \r
        return xReturn;\r
 }\r