mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +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:
parent
8a706f836d
commit
1ba44957bf
@ -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)) !=
|
||||
|
Loading…
Reference in New Issue
Block a user