Commit a6d5f40b authored by 's avatar
Browse files

various fixes

git-svn-id: file:///home/svn/mapi/trunk@225 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 846c5b07
......@@ -110,7 +110,9 @@ void mapiipc_remote_write_to_all(remote_flowdescr_t* rflow)
{
host_flow* hflow;
flist_node_t* fnode;
pthread_mutex_lock(&rflow->mutex);
rflow->pending_msgs=0;
for (fnode=flist_head(rflow->host_flowlist); fnode!=NULL; fnode=flist_next(fnode)) {
hflow=(host_flow*)fnode->data;
hflow->dbuf->fd=hflow->fd;
......@@ -129,6 +131,7 @@ void *mapiipc_comm_thread(void *host) {
host_flow* hflow;
int recv_bytes;
unsigned int dbuf_bytes=0;
int pending;
dbuf=(struct dmapiipcbuf*)&buffer[0];
......@@ -159,16 +162,17 @@ void *mapiipc_comm_thread(void *host) {
}
pthread_mutex_lock(&rflow->mutex);
if (rflow->pending_msgs>0) {
pthread_mutex_lock(&rflow->mutex);
--rflow->pending_msgs;
pending=rflow->pending_msgs;
pthread_mutex_unlock(&rflow->mutex);
if ( rflow->pending_msgs==0 ) {
if ( pending==0 ) {
sem_post( &rflow->fd_sem );
}
}
else pthread_mutex_unlock(&rflow->mutex);
}
else {
printf("INTERNAL SERIOUS FAILURE %d\n",dbuf->fd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment