diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-19 17:56:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-03-19 17:56:15 +0000 |
commit | 5fac8e83aba8dcd6493d8502783e471c8ddf2be6 (patch) | |
tree | 5d423851b7062520785d7624c9a1d0b3a09ce33b /nuttx/sched/pthread_condsignal.c | |
parent | d1aa52f99c7510c1f515a4cac81bf4fac3083c83 (diff) | |
download | px4-nuttx-5fac8e83aba8dcd6493d8502783e471c8ddf2be6.tar.gz px4-nuttx-5fac8e83aba8dcd6493d8502783e471c8ddf2be6.tar.bz2 px4-nuttx-5fac8e83aba8dcd6493d8502783e471c8ddf2be6.zip |
Minor updates for PIC32 USB device driver bugs
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4497 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/pthread_condsignal.c')
-rw-r--r-- | nuttx/sched/pthread_condsignal.c | 13 |
1 files changed, 11 insertions, 2 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) { |