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.
This commit is contained in:
Joel Sherrill
2005-10-04 21:53:58 +00:00
parent dc4bd19dfa
commit a3b4632866
3 changed files with 24 additions and 6 deletions

View File

@@ -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

View File

@@ -108,10 +108,14 @@ User_extensions_routine _RTEMS_tasks_Delete_extension(
deleted->task_variables = NULL;
while (tvp) {
next = tvp->next;
if (_Thread_Is_executing(deleted)) {
if (tvp->dtor)
(*tvp->dtor)(*tvp->ptr);
if (_Thread_Is_executing(deleted))
*tvp->ptr = tvp->gval;
} else {
if (tvp->dtor)
(*tvp->dtor)(tvp->tval);
}
_Workspace_Free( tvp );
tvp = next;
}

View File

@@ -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 (_Thread_Is_executing(the_thread)) {
if (tvp->dtor)
(*tvp->dtor)(*tvp->ptr);
if (_Thread_Is_executing(the_thread))
*tvp->ptr = tvp->gval;
} else {
if (tvp->dtor)
(*tvp->dtor)(tvp->tval);
}
_Workspace_Free(tvp);
_Thread_Enable_dispatch();
return RTEMS_SUCCESSFUL;