diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-10-04 21:55:24 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2005-10-04 21:55:24 +0000 |
commit | a93a23951ebe51f350777d530a2e7feaa1bc1e61 (patch) | |
tree | b5c86f7c65b41b6c6d5cb2f619d2ad389ee5ebd2 /cpukit/rtems/src/tasks.c | |
parent | Remove floating point calculations and the C preprocessor conditions which en... (diff) | |
download | rtems-a93a23951ebe51f350777d530a2e7feaa1bc1e61.tar.bz2 |
2005-10-04 Till Straumann <strauman@slac.stanford.edu>
PR 829/rtems
* rtems/src/tasks.c, rtems/src/taskvariabledelete.c: If task variables
are deleted from a different context (i.e., executing context !=
owner of the task variable. The owner meaning the task that
registered the dtor in question) the argument passed to the task
variable dtor must be tvar and not *ptr which yields the executing
task's value of the task variable instead of the owner's.
Diffstat (limited to 'cpukit/rtems/src/tasks.c')
-rw-r--r-- | cpukit/rtems/src/tasks.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c index bf2fdbb2ed..83c6b3928a 100644 --- a/cpukit/rtems/src/tasks.c +++ b/cpukit/rtems/src/tasks.c @@ -112,10 +112,14 @@ User_extensions_routine _RTEMS_tasks_Delete_extension( deleted->task_variables = NULL; while (tvp) { next = tvp->next; - if (tvp->dtor) + if (_Thread_Is_executing(deleted)) { + if (tvp->dtor) (*tvp->dtor)(*tvp->ptr); - if (_Thread_Is_executing(deleted)) - *tvp->ptr = tvp->gval; + *tvp->ptr = tvp->gval; + } else { + if (tvp->dtor) + (*tvp->dtor)(tvp->tval); + } _Workspace_Free( tvp ); tvp = next; } |