Back out the last change. I just noticed some complexities that need to be verified before this is released onto the world.

This commit is contained in:
Gregory Nutt
2016-11-30 07:41:48 -06:00
parent 8453343426
commit e6eb2e8bfa
+17
View File
@@ -281,7 +281,9 @@ static void note_add(FAR const uint8_t *note, uint8_t notelen)
{
unsigned int head;
unsigned int next;
#if 0 /* Backed out for now. */
unsigned int nxthd;
#endif
#ifdef CONFIG_SMP
/* Ignore notes that are not in the set of monitored CPUs */
@@ -294,6 +296,11 @@ static void note_add(FAR const uint8_t *note, uint8_t notelen)
}
#endif
#if 0 /* Backed out for now. This could advance the head index and wrap
* past the tail index. I am not sure how this would interact with
* note_remove(). Needs time to test and verify.
*/
DEBUGASSERT(note != NULL && notelen < CONFIG_SCHED_NOTE_BUFSIZE);
do
@@ -325,6 +332,12 @@ static void note_add(FAR const uint8_t *note, uint8_t notelen)
g_note_info.ni_head = nxthd;
}
while (nxthd != g_note_info.ni_head);
#else
/* Get the index to the head of the circular buffer */
DEBUGASSERT(note != NULL && notelen < CONFIG_SCHED_NOTE_BUFSIZE);
head = g_note_info.ni_head;
#endif
/* Loop until all bytes have been transferred to the circular buffer */
@@ -350,7 +363,11 @@ static void note_add(FAR const uint8_t *note, uint8_t notelen)
notelen--;
}
#if 0 /* Backed out for now. */
DEBUGASSERT(head == nxthd);
#else
g_note_info.ni_head = head;
#endif
}
/****************************************************************************