diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-01-31 23:39:12 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-01-31 23:39:12 +0000 |
commit | 35a1f247c44339eb39ae20b85b575d2e6e61a0cc (patch) | |
tree | 4ec59e18f087faba4945cf1bb1d7855d44e82080 /nuttx/sched/atexit.c | |
parent | ed4ee27f70c63909417a8854668a8fe057a971ff (diff) | |
download | px4-firmware-35a1f247c44339eb39ae20b85b575d2e6e61a0cc.tar.gz px4-firmware-35a1f247c44339eb39ae20b85b575d2e6e61a0cc.tar.bz2 px4-firmware-35a1f247c44339eb39ae20b85b575d2e6e61a0cc.zip |
Add on_exit(); Re-order some logic in the task shutdown sequence. Sometimes some complex logic needs to execute when closing file descriptors and this needs to happen early while the task is still healthy
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4354 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched/atexit.c')
-rw-r--r-- | nuttx/sched/atexit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/nuttx/sched/atexit.c b/nuttx/sched/atexit.c index 3a116f4c1..da1be1c2a 100644 --- a/nuttx/sched/atexit.c +++ b/nuttx/sched/atexit.c @@ -1,8 +1,8 @@ /************************************************************************ * sched/atexit.c * - * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -52,7 +52,7 @@ #ifdef CONFIG_SCHED_ATEXIT /************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************/ /************************************************************************ @@ -72,7 +72,7 @@ ************************************************************************/ /************************************************************************ - * Private Functionss + * Private Functions ************************************************************************/ /************************************************************************ @@ -101,9 +101,9 @@ int atexit(void (*func)(void)) /* The following must be atomic */ sched_lock(); - if (func && !tcb->exitfunc) + if (func && !tcb->atexitfunc) { - tcb->exitfunc = func; + tcb->atexitfunc = func; ret = OK; } |