From 610a6c9a4d50657d5f04d3247a229795e599be3b Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 20 Jul 2011 13:19:07 +0000 Subject: Fix for sem_timedwait.c git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3803 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/sched/sem_timedwait.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'nuttx/sched/sem_timedwait.c') 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 * * 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. */ -- cgit v1.2.3