From: richardbarry Date: Thu, 1 May 2008 17:15:36 +0000 (+0000) Subject: Added code to allow a vTaskPrioritySet() caller to pass in the current TCB as well... X-Git-Tag: V5.0.2~65 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6a55b4faa1931ecc383b091c110306e072edcf22;p=freertos Added code to allow a vTaskPrioritySet() caller to pass in the current TCB as well as NULL to indicate that the priority of the calling task is being changed. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@332 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/Source/tasks.c b/Source/tasks.c index 471ec7bd5..ade94f971 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -779,6 +779,11 @@ tskTCB * pxNewTCB; taskENTER_CRITICAL(); { + if( pxTask == pxCurrentTCB ) + { + pxTask = NULL; + } + /* If null is passed in here then we are changing the priority of the calling function. */ pxTCB = prvGetTCBFromHandle( pxTask ); @@ -949,7 +954,7 @@ tskTCB * pxNewTCB; /* The parameter cannot be NULL as it is impossible to resume the currently executing task. */ - if( pxTCB != NULL ) + if( ( pxTCB != NULL ) && ( pxTCB != pxCurrentTCB ) ) { taskENTER_CRITICAL(); {