Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
VPP-598: tcp stack initial commit
[vpp.git]
/
src
/
vlibmemory
/
unix_shared_memory_queue.c
diff --git
a/src/vlibmemory/unix_shared_memory_queue.c
b/src/vlibmemory/unix_shared_memory_queue.c
index
25d2891
..
e86edec
100644
(file)
--- a/
src/vlibmemory/unix_shared_memory_queue.c
+++ b/
src/vlibmemory/unix_shared_memory_queue.c
@@
-33,18
+33,13
@@
* nels = number of elements on the queue
* elsize = element size, presumably 4 and cacheline-size will
* be popular choices.
* nels = number of elements on the queue
* elsize = element size, presumably 4 and cacheline-size will
* be popular choices.
- * coid = consumer coid, from ChannelCreate
* pid = consumer pid
* pid = consumer pid
- * pulse_code = pulse code consumer expects
- * pulse_value = pulse value consumer expects
- * consumer_prio = consumer's priority, so pulses won't change
- * the consumer's priority.
*
* The idea is to call this function in the queue consumer,
* and e-mail the queue pointer to the producer(s).
*
*
* The idea is to call this function in the queue consumer,
* and e-mail the queue pointer to the producer(s).
*
- * The
s
pp process / main thread allocates one of these
- * at startup; its main input queue. The
s
pp main input queue
+ * The
v
pp process / main thread allocates one of these
+ * at startup; its main input queue. The
v
pp main input queue
* has a pointer to it in the shared memory segment header.
*
* You probably want to be on an svm data heap before calling this
* has a pointer to it in the shared memory segment header.
*
* You probably want to be on an svm data heap before calling this
@@
-70,7
+65,7
@@
unix_shared_memory_queue_init (int nels,
q->signal_when_queue_non_empty = signal_when_queue_non_empty;
memset (&attr, 0, sizeof (attr));
q->signal_when_queue_non_empty = signal_when_queue_non_empty;
memset (&attr, 0, sizeof (attr));
- memset (&cattr, 0, sizeof (attr));
+ memset (&cattr, 0, sizeof (
c
attr));
if (pthread_mutexattr_init (&attr))
clib_unix_warning ("mutexattr_init");
if (pthread_mutexattr_init (&attr))
clib_unix_warning ("mutexattr_init");
@@
-277,6
+272,7
@@
unix_shared_memory_queue_sub (unix_shared_memory_queue_t * q,
clib_memcpy (elem, headp, q->elsize);
q->head++;
clib_memcpy (elem, headp, q->elsize);
q->head++;
+ /* $$$$ JFC shouldn't this be == 0? */
if (q->cursize == q->maxsize)
need_broadcast = 1;
if (q->cursize == q->maxsize)
need_broadcast = 1;