]> git.sur5r.net Git - freertos/commitdiff
Added code to allow a vTaskPrioritySet() caller to pass in the current TCB as well...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 1 May 2008 17:15:36 +0000 (17:15 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 1 May 2008 17:15:36 +0000 (17:15 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@332 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

index 471ec7bd5e8edf6b74db0d4a75ac35aacae9d1fa..ade94f971c015798db82c2183e0f9d25e553f756 100644 (file)
@@ -779,6 +779,11 @@ tskTCB * pxNewTCB;
 \r
                taskENTER_CRITICAL();\r
                {\r
+                       if( pxTask == pxCurrentTCB )\r
+                       {\r
+                               pxTask = NULL;\r
+                       }\r
+\r
                        /* If null is passed in here then we are changing the\r
                        priority of the calling function. */\r
                        pxTCB = prvGetTCBFromHandle( pxTask );\r
@@ -949,7 +954,7 @@ tskTCB * pxNewTCB;
 \r
                /* The parameter cannot be NULL as it is impossible to resume the\r
                currently executing task. */\r
-               if( pxTCB != NULL )\r
+               if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) )\r
                {\r
                        taskENTER_CRITICAL();\r
                        {\r