Project

General

Profile

lighttpd-fast-exit.diff

peto, 2008-10-31 02:39

View differences:

network_gthread_sendfile.c (working copy)
95 95
		g_time_val_add(&ts, 500 * 1000);
96 96

  
97 97
		if ((wj = g_async_queue_timed_pop(inq, &ts))) {
98
			if(wj == (write_job *) 1)
99
				continue; /* just notifying us that srv->is_shutdown changed */
100

  
98 101
			/* let's see what we have to stat */
99 102
			ssize_t r;
100 103
			off_t offset;
stat_cache.c (working copy)
120 120
		g_time_val_add(&ts, 500 * 1000); 
121 121

  
122 122
		if ((sj = g_async_queue_timed_pop(inq, &ts))) {
123
			if(sj == (stat_job *) 1)
124
				continue; /* just notifying us that srv->is_shutdown changed */
125

  
123 126
			/* don't care about the return code for now */
124 127
			stat(sj->name->ptr, &st);
125 128

  
server.c (working copy)
868 874
			/* we are in graceful shutdown phase and all connections are closed
869 875
			 * we are ready to terminate without harming anyone */
870 876
			srv_shutdown = 1;
877
			continue;
871 878
		}
872 879

  
873 880
		/* we still have some fds to share */
......
1815 1825
	}
1816 1826

  
1817 1827
	for (i = 0; i < srv->srvconf.max_stat_threads; i++) {
1828
                g_async_queue_push(srv->stat_queue, (void *) 1);
1829
	}
1830

  
1831
	for (i = 0; i < srv->srvconf.max_stat_threads; i++) {
1818 1832
		g_thread_join(stat_cache_threads[i]);
1819 1833
	}
1820 1834

  
......
1824 1838
	g_mutex_unlock(joblist_queue_mutex);
1825 1839
	g_cond_signal(joblist_queue_cond);
1826 1840

  
1827
	if (joblist_queue_thread_id) g_thread_join(joblist_queue_thread_id);
1841
	if (joblist_queue_thread_id) {
1842
		g_async_queue_push(srv->joblist_queue, (void *) 1);
1843
		g_thread_join(joblist_queue_thread_id);
1844
	}
1828 1845

  
1829 1846
#if 0
1830 1847
	g_mutex_lock(joblist_queue_mutex);