Move the mirror commit state mbox to struct control

The mirror_super signals the commit state to the control thread via an
mbox, and this mbox is moved to control.  It was owned by mirror_super,
but the problem with that is that mirror_super can free the mbox before
the control client has been scheduled to receive the message.  If it's
owned by the control object, that can't happen.
This commit is contained in:
Alex Young
2012-07-15 21:57:36 +01:00
parent b20fbc6a66
commit 10625e402b
6 changed files with 81 additions and 35 deletions

View File

@@ -55,11 +55,11 @@ void * mbox_receive( struct mbox * mbox )
mbox->full = 0;
result = mbox->contents;
mbox->contents = NULL;
while( 0 != pthread_cond_signal( &mbox->emptied_cond));
}
pthread_mutex_unlock( &mbox->mutex );
return result;
}