diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-03-19 17:56:15 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-03-19 17:56:15 +0000 |
commit | aa37eeaa03f819cb3cf591b63dc2ee463fc78047 (patch) | |
tree | 5d423851b7062520785d7624c9a1d0b3a09ce33b /nuttx/sched | |
parent | 199e9314622731714c0331264a52e8b1d00a1d4e (diff) | |
download | px4-firmware-aa37eeaa03f819cb3cf591b63dc2ee463fc78047.tar.gz px4-firmware-aa37eeaa03f819cb3cf591b63dc2ee463fc78047.tar.bz2 px4-firmware-aa37eeaa03f819cb3cf591b63dc2ee463fc78047.zip |
Minor updates for PIC32 USB device driver bugs
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4497 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/pthread_condsignal.c | 13 | ||||
-rw-r--r-- | nuttx/sched/pthread_condwait.c | 4 |
2 files changed, 13 insertions, 4 deletions
diff --git a/nuttx/sched/pthread_condsignal.c b/nuttx/sched/pthread_condsignal.c index a10dda6be..8f96532df 100644 --- a/nuttx/sched/pthread_condsignal.c +++ b/nuttx/sched/pthread_condsignal.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/pthread_condsignal.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009, 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 @@ -112,6 +112,15 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) else { + /* One of my objectives in this design was to make pthread_cond_signal + * usable from interrupt handlers. However, from interrupt handlers, + * you cannot take the associated mutex before signaling the condition. + * As a result, I think that there could be a race condition with + * the following logic which assumes that the if sval < 0 then the + * thread is waiting. Without the mutex, there is no atomic, protected + * operation that will guarantee this to be so. + */ + sdbg("sval=%d\n", sval); if (sval < 0) { diff --git a/nuttx/sched/pthread_condwait.c b/nuttx/sched/pthread_condwait.c index 38e3ddeb9..986349137 100644 --- a/nuttx/sched/pthread_condwait.c +++ b/nuttx/sched/pthread_condwait.c @@ -1,8 +1,8 @@ /**************************************************************************** * sched/pthread_condwait.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Copyright (C) 2007-2009, 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 |