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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user