integrating event_add_timer, am I doing this right?

arosolino nginx-forum at nginx.us
Sun Jul 8 07:00:14 UTC 2012


I think I figured this out on my own, there posed an issue if a worker
thread died. NGINX will automatically respawn a new one, and I need to
make sure the event attaches to the new one. This code ended up working
good.

	// There is already an event owner set.
	if(dosstop_shm->event_owner)
	{
		// Does the PID still exist?
        for (s = 0; s < ngx_last_process; s++) {
            if (ngx_processes[s].pid == dosstop_shm->event_owner &&
!ngx_processes[s].exited) {
				ngx_shmtx_unlock(&shpool->mutex);
                return NGX_OK;
            }
        }
	}

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,228369,228383#msg-228383



More information about the nginx mailing list