summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-06-28 11:56:48 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-06-28 11:56:48 -0600
commit065ae5cf6f729111929d7f0f7bb04f0e47149895 (patch)
treef90aacf95f69281bd5e5d7850b7e79834f5f2936
parent061de44b774696ba47b903bfaa52599103348a74 (diff)
downloadnuttx-065ae5cf6f729111929d7f0f7bb04f0e47149895.tar.gz
nuttx-065ae5cf6f729111929d7f0f7bb04f0e47149895.tar.bz2
nuttx-065ae5cf6f729111929d7f0f7bb04f0e47149895.zip
NET: Last tweaks were still in the editor
-rw-r--r--nuttx/net/iob/iob_alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nuttx/net/iob/iob_alloc.c b/nuttx/net/iob/iob_alloc.c
index 1bfbab7c4..72da2c9ed 100644
--- a/nuttx/net/iob/iob_alloc.c
+++ b/nuttx/net/iob/iob_alloc.c
@@ -89,7 +89,6 @@ static FAR struct iob_s *iob_tryalloc(bool throttled)
irqstate_t flags;
#if CONFIG_IOB_THROTTLE > 0
FAR sem_t *sem;
- int semcount;
#endif
#if CONFIG_IOB_THROTTLE > 0
@@ -133,6 +132,10 @@ static FAR struct iob_s *iob_tryalloc(bool throttled)
DEBUGASSERT(g_iob_sem.semcount >= 0);
#if CONFIG_IOB_THROTTLE > 0
+ /* The throttle semaphore is a little more complicated because
+ * it can be negative! Decrementing is still safe, however.
+ */
+
g_throttle_sem.semcount--;
DEBUGASSERT(g_throttle_sem.semcount >= -CONFIG_IOB_THROTTLE);
#endif