From c941a980ccbd8def1d925fc5c69a22f40e1e5060 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 21 Jan 2000 15:07:55 +0000 Subject: Patch from Eric Norum to implement this: I'd like to propose a change to RTEMS task variables that I think would make them more useful. I think that it is early enough in their existence to still make changes to their API. 1) Change type from `int' to `void *'. 2) Add extra argument to task_variable_add -- if non-NULL, a pointer to a `destructor' function to be called when the task exits. This function would be called with that task's value of the task variable as its argument. In many cases, the `dtor' function could be `free'. rtems_status_code rtems_task_variable_add ( rtems_id tid, void **ptr, void (*dtor)(void *)); rtems_status_code rtems_task_variable_delete (rtems_id tid, void **ptr); This would be all we'd need to cleanly and efficiently support C++ per-thread exception information without dragging in all that POSIX API stuff. --- c/src/exec/rtems/include/rtems/rtems/tasks.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'c/src/exec/rtems/include/rtems') diff --git a/c/src/exec/rtems/include/rtems/rtems/tasks.h b/c/src/exec/rtems/include/rtems/rtems/tasks.h index fa574bba8a..f9234e6e89 100644 --- a/c/src/exec/rtems/include/rtems/rtems/tasks.h +++ b/c/src/exec/rtems/include/rtems/rtems/tasks.h @@ -412,7 +412,8 @@ rtems_status_code rtems_task_is_suspended( rtems_status_code rtems_task_variable_add( rtems_id tid, - int *ptr + void **ptr, + void (*dtor)(void *) ); /* @@ -423,7 +424,7 @@ rtems_status_code rtems_task_variable_add( rtems_status_code rtems_task_variable_delete( rtems_id tid, - int *ptr + void **ptr ); /* -- cgit v1.2.3