summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2005-10-04 21:53:58 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2005-10-04 21:53:58 +0000
commita3b463286675a4a2c6fc0a91884a06f40d3dbbc8 (patch)
treeb70540de7a8dcb34cd7e4f411e4961292052e69f
parentRemoved blank line. (diff)
downloadrtems-a3b463286675a4a2c6fc0a91884a06f40d3dbbc8.tar.bz2
2005-10-04 Till Straumann <strauman@slac.stanford.edu>
PR 829/rtems * src/tasks.c, 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.
-rw-r--r--cpukit/rtems/ChangeLog10
-rw-r--r--cpukit/rtems/src/tasks.c10
-rw-r--r--cpukit/rtems/src/taskvariabledelete.c10
3 files changed, 24 insertions, 6 deletions
diff --git a/cpukit/rtems/ChangeLog b/cpukit/rtems/ChangeLog
index 9049a395b7..aa16e390bc 100644
--- a/cpukit/rtems/ChangeLog
+++ b/cpukit/rtems/ChangeLog
@@ -1,3 +1,13 @@
+2005-10-04 Till Straumann <strauman@slac.stanford.edu>
+
+ PR 829/rtems
+ * src/tasks.c, 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.
+
2005-08-18 Andrew Sinclair <Andrew.Sinclair@elprotech.com>
PR 807/rtems
diff --git a/cpukit/rtems/src/tasks.c b/cpukit/rtems/src/tasks.c
index b7eadbea8a..19f0fcfaa3 100644
--- a/cpukit/rtems/src/tasks.c
+++ b/cpukit/rtems/src/tasks.c
@@ -108,10 +108,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;
}
diff --git a/cpukit/rtems/src/taskvariabledelete.c b/cpukit/rtems/src/taskvariabledelete.c
index b96f317e06..8fd900296b 100644
--- a/cpukit/rtems/src/taskvariabledelete.c
+++ b/cpukit/rtems/src/taskvariabledelete.c
@@ -56,10 +56,14 @@ rtems_status_code rtems_task_variable_delete(
if (tvp->ptr == ptr) {
if (prev) prev->next = tvp->next;
else the_thread->task_variables = tvp->next;
- if (tvp->dtor)
- (*tvp->dtor)(*tvp->ptr);
- if (_Thread_Is_executing(the_thread))
+ if (_Thread_Is_executing(the_thread)) {
+ if (tvp->dtor)
+ (*tvp->dtor)(*tvp->ptr);
*tvp->ptr = tvp->gval;
+ } else {
+ if (tvp->dtor)
+ (*tvp->dtor)(tvp->tval);
+ }
_Workspace_Free(tvp);
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;