sched/task: Avoid the cast in atexit when CONFIG_SCHED_ONEXIT is defined
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: Ic3360555fa8bb24d5dae52e7ae5bb5fb5c24de0c
This commit is contained in:
parent
3409c989bd
commit
09f64dd0ac
1 changed files with 12 additions and 1 deletions
|
@ -52,6 +52,17 @@
|
||||||
|
|
||||||
#ifdef CONFIG_SCHED_ATEXIT
|
#ifdef CONFIG_SCHED_ATEXIT
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Private Functions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifdef CONFIG_SCHED_ONEXIT
|
||||||
|
static void exitfunc(int exitcode, FAR void *arg)
|
||||||
|
{
|
||||||
|
(*(atexitfunc_t)arg)();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -95,7 +106,7 @@ int atexit(void (*func)(void))
|
||||||
* it expects).
|
* it expects).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return on_exit((onexitfunc_t)func, NULL);
|
return on_exit(exitfunc, func);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
FAR struct tcb_s *tcb = this_task();
|
FAR struct tcb_s *tcb = this_task();
|
||||||
|
|
Loading…
Reference in a new issue