Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix typo (double unlock)
[vpp.git]
/
src
/
vlibmemory
/
memory_vlib.c
diff --git
a/src/vlibmemory/memory_vlib.c
b/src/vlibmemory/memory_vlib.c
index
c3aef65
..
7ae7867
100644
(file)
--- a/
src/vlibmemory/memory_vlib.c
+++ b/
src/vlibmemory/memory_vlib.c
@@
-188,7
+188,6
@@
vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
int rv = 0;
void *oldheap;
api_main_t *am = &api_main;
int rv = 0;
void *oldheap;
api_main_t *am = &api_main;
- u8 *serialized_message_table_in_shmem;
/*
* This is tortured. Maintain a vlib-address-space private
/*
* This is tortured. Maintain a vlib-address-space private
@@
-237,7
+236,9
@@
vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
regp->name = format (0, "%s", mp->name);
vec_add1 (regp->name, 0);
regp->name = format (0, "%s", mp->name);
vec_add1 (regp->name, 0);
- serialized_message_table_in_shmem = vl_api_serialize_message_table (am, 0);
+ if (am->serialized_message_table_in_shmem == 0)
+ am->serialized_message_table_in_shmem =
+ vl_api_serialize_message_table (am, 0);
pthread_mutex_unlock (&svm->mutex);
svm_pop_heap (oldheap);
pthread_mutex_unlock (&svm->mutex);
svm_pop_heap (oldheap);
@@
-250,7
+251,8
@@
vl_api_memclnt_create_t_handler (vl_api_memclnt_create_t * mp)
am->shmem_hdr->application_restarts);
rp->context = mp->context;
rp->response = ntohl (rv);
am->shmem_hdr->application_restarts);
rp->context = mp->context;
rp->response = ntohl (rv);
- rp->message_table = pointer_to_uword (serialized_message_table_in_shmem);
+ rp->message_table =
+ pointer_to_uword (am->serialized_message_table_in_shmem);
vl_msg_api_send_shmem (q, (u8 *) & rp);
}
vl_msg_api_send_shmem (q, (u8 *) & rp);
}
@@
-498,7
+500,7
@@
vl_api_api_versions_t_handler (vl_api_api_versions_t * mp)
rmp->api_versions[i].major = htonl (vl->major);
rmp->api_versions[i].minor = htonl (vl->minor);
rmp->api_versions[i].patch = htonl (vl->patch);
rmp->api_versions[i].major = htonl (vl->major);
rmp->api_versions[i].minor = htonl (vl->minor);
rmp->api_versions[i].patch = htonl (vl->patch);
- strncpy ((char *) rmp->api_versions[i].name, vl->name, 64);
+ strncpy ((char *) rmp->api_versions[i].name, vl->name, 64
- 1
);
}
vl_msg_api_send_shmem (q, (u8 *) & rmp);
}
vl_msg_api_send_shmem (q, (u8 *) & rmp);
@@
-1022,11
+1024,10
@@
skip_save:
if (PREDICT_FALSE (q->head == q->maxsize))
q->head = 0;
pthread_mutex_unlock (&q->mutex);
if (PREDICT_FALSE (q->head == q->maxsize))
q->head = 0;
pthread_mutex_unlock (&q->mutex);
+
if (need_broadcast)
(void) pthread_cond_broadcast (&q->condvar);
if (need_broadcast)
(void) pthread_cond_broadcast (&q->condvar);
- pthread_mutex_unlock (&q->mutex);
-
vl_msg_api_handler_with_vm_node (am, (void *) mp, vm, node);
}
else
vl_msg_api_handler_with_vm_node (am, (void *) mp, vm, node);
}
else