]> git.sur5r.net Git - freertos/commitdiff
When creating a task - move where the task handle is assigned to the function paramet...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 21 Sep 2010 21:10:41 +0000 (21:10 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Tue, 21 Sep 2010 21:10:41 +0000 (21:10 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1115 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

index ddbddaa8038a170a777d154009cb480d8fe7e1a1..91e85672430b3834e5772f5bc70eae607ee95778 100644 (file)
@@ -447,6 +447,14 @@ tskTCB * pxNewTCB;
                }\r
                #endif\r
 \r
+               if( ( void * ) pxCreatedTask != NULL )\r
+               {\r
+                       /* Pass the TCB out - in an anonymous way.  The calling function/\r
+                       task can use this as a handle to delete the task later if\r
+                       required.*/\r
+                       *pxCreatedTask = ( xTaskHandle ) pxNewTCB;\r
+               }\r
+               \r
                /* We are going to manipulate the task queues to add this task to a\r
                ready list, so must make sure no interrupts occur. */\r
                portENTER_CRITICAL();\r
@@ -506,14 +514,6 @@ tskTCB * pxNewTCB;
 \r
        if( xReturn == pdPASS )\r
        {\r
-               if( ( void * ) pxCreatedTask != NULL )\r
-               {\r
-                       /* Pass the TCB out - in an anonymous way.  The calling function/\r
-                       task can use this as a handle to delete the task later if\r
-                       required.*/\r
-                       *pxCreatedTask = ( xTaskHandle ) pxNewTCB;\r
-               }\r
-\r
                if( xSchedulerRunning != pdFALSE )\r
                {\r
                        /* If the created task is of a higher priority than the current task\r