Remove the accept lock as being unneeded

This commit is contained in:
Alex Young
2012-06-06 14:07:55 +01:00
parent 1fc76ad77f
commit e8b47d5855
3 changed files with 0 additions and 26 deletions

View File

@@ -66,11 +66,6 @@ void* mirror_runner(void* serve_params_uncast)
debug("mirror start pass=%d", pass);
if (pass == last_pass) {
/* last pass, stop everything else */
SERVER_ERROR_ON_FAILURE(
pthread_mutex_lock(&serve->l_accept),
"Problem with accept lock"
);
server_lock_io( serve );
}
@@ -146,10 +141,6 @@ void* mirror_runner(void* serve_params_uncast)
free(serve->mirror);
serve->mirror = NULL; /* and we're gone */
SERVER_ERROR_ON_FAILURE(
pthread_mutex_unlock(&serve->l_accept),
"Problem with accept unlock"
);
server_unlock_io( serve );
return NULL;

View File

@@ -284,20 +284,12 @@ void serve_accept_loop(struct server* params)
params->control_fd;
client_fd = accept(activity_fd, &client_address.generic, &socklen);
SERVER_ERROR_ON_FAILURE(
pthread_mutex_lock(&params->l_accept),
"Problem with accept lock"
);
if (activity_fd == params->server_fd)
accept_nbd_client(params, client_fd, &client_address);
if (activity_fd == params->control_fd)
accept_control_connection(params, client_fd, &client_address);
SERVER_ERROR_ON_FAILURE(
pthread_mutex_unlock(&params->l_accept),
"Problem with accept unlock"
);
}
}
@@ -338,7 +330,6 @@ void serve_cleanup(struct server* params)
//free(params->filename);
if (params->control_socket_name)
//free(params->control_socket_name);
pthread_mutex_destroy(&params->l_accept);
pthread_mutex_destroy(&params->l_io);
if (params->proxy_fd);
close(params->proxy_fd);
@@ -363,7 +354,6 @@ void serve_cleanup(struct server* params)
/** Full lifecycle of the server */
void do_serve(struct server* params)
{
pthread_mutex_init(&params->l_accept, NULL);
pthread_mutex_init(&params->l_io, NULL);
params->close_signal = self_pipe_create();

View File

@@ -56,13 +56,6 @@ struct server {
/** size of file */
off64_t size;
/* NB dining philosophers if we ever mave more than one thread
* that might need to pause the whole server. At the moment we only
* have the one.
*/
/** Claimed around any accept/thread starting loop */
pthread_mutex_t l_accept;
/** Claims around any I/O to this file */
pthread_mutex_t l_io;