On Wed, Oct 21, 2009 at 9:08 PM, Bojan Smojver <[email protected]> wrote: > Looking at this function in worker.c: > ---------------- > static void close_worker_sockets(void) > { > int i; > for (i = 0; i < ap_threads_per_child; i++) { > if (worker_sockets[i]) { > apr_socket_close(worker_sockets[i]); > worker_sockets[i] = NULL; > } > } > } > ---------------- > > Isn't there are possible race condition there, given that worker threads > can also change worker_sockets[i] at the same time? Or are we suspending > worker threads before this gets called?
I have long suspected that there is a race here, and that this code should do shutdown for read and write rather than close in order to avoid any possible funny business with descriptors.
