diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-07-20 13:19:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-07-20 13:19:07 +0000 |
commit | 610a6c9a4d50657d5f04d3247a229795e599be3b (patch) | |
tree | e03560a19826bb362dfe3b21743ff232b940e272 /nuttx/sched/sem_timedwait.c | |
parent | 622a6cc576f1e5b97abcb78441ed04674217bfe6 (diff) | |
download | px4-nuttx-610a6c9a4d50657d5f04d3247a229795e599be3b.tar.gz px4-nuttx-610a6c9a4d50657d5f04d3247a229795e599be3b.tar.bz2 px4-nuttx-610a6c9a4d50657d5f04d3247a229795e599be3b.zip |
Fix for sem_timedwait.c
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3803 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sem_timedwait.c')
-rw-r--r-- | nuttx/sched/sem_timedwait.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/nuttx/sched/sem_timedwait.c b/nuttx/sched/sem_timedwait.c index 7b01d22d8..5a1b943a5 100644 --- a/nuttx/sched/sem_timedwait.c +++ b/nuttx/sched/sem_timedwait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_timedwait.c * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * Copyright (C) 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -51,6 +51,7 @@ #include "os_internal.h" #include "clock_internal.h" +#include "sem_internal.h" /**************************************************************************** * Pre-processor Definitions @@ -111,13 +112,9 @@ static void sem_timeout(int argc, uint32_t pid) if (wtcb && wtcb->task_state == TSTATE_WAIT_SEM) { - /* Mark the errno value for the thread. */ - - wtcb->pterrno = ETIMEDOUT; - - /* Restart the task. */ - - up_unblock_task(wtcb); + /* Cancel the semaphore wait */ + + sem_waitirq(wtcb, ETIMEDOUT); } /* Interrupts may now be enabled. */ |