1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

Add some fixme locking

Code here is using thread write protected variable without locking.
So add locking, for proper synchronization and a FIXME, since the
code needs closer look.
This commit is contained in:
Zdenek Kabelac 2011-10-11 09:56:44 +00:00
parent 8a706f836d
commit 1ba44957bf

View File

@ -747,12 +747,16 @@ static int local_pipe_callback(struct local_client *thisfd, char *buf,
send_local_reply(sock_client, status,
sock_client->fd);
else {
/* FIXME: closer inspect this code since state is write thread protected */
pthread_mutex_lock(&sock_client->bits.localsock.mutex);
if (sock_client->bits.localsock.state ==
POST_COMMAND) {
pthread_mutex_unlock(&sock_client->bits.localsock.mutex);
send_local_reply(sock_client, 0,
sock_client->fd);
} else // PRE_COMMAND finished.
{
pthread_mutex_unlock(&sock_client->bits.localsock.mutex);
if (
(status =
distribute_command(sock_client)) !=