From 795aa5e24cee83c88b8a6ea3a3fd06e754f55010 Mon Sep 17 00:00:00 2001 From: Jerome Flesch Date: Fri, 27 May 2011 13:42:42 +0200 Subject: [PATCH] coroipcc_dispatch_get(): Fix --enable-small-memory-footprint support Signed-off-by: Jerome Flesch Reviewed-by: Jan Friesse --- lib/coroipcc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/coroipcc.c b/lib/coroipcc.c index 6fe70e35..0709614d 100644 --- a/lib/coroipcc.c +++ b/lib/coroipcc.c @@ -847,6 +847,17 @@ coroipcc_dispatch_get ( return (error); } + if (shared_mem_dispatch_bytes_left (ipc_instance) > (ipc_instance->dispatch_size/2)) { + /* + * Notify coroipcs to flush any pending dispatch messages + */ + res = ipc_sem_post (ipc_instance->control_buffer, SEMAPHORE_REQUEST_OR_FLUSH_OR_EXIT); + if (res != CS_OK) { + error = CS_ERR_LIBRARY; + goto error_put; + } + } + *data = NULL; ufds.fd = ipc_instance->fd; @@ -881,7 +892,7 @@ coroipcc_dispatch_get ( #endif assert (error == CS_OK); - if (shared_mem_dispatch_bytes_left (ipc_instance) > 500000) { + if (shared_mem_dispatch_bytes_left (ipc_instance) > (ipc_instance->dispatch_size/2)) { /* * Notify coroipcs to flush any pending dispatch messages */