# HG changeset patch # User reimar # Date 1274896571 0 # Node ID 09e3134b649d155a7e0f543e17b5efccca610548 # Parent d8929af71fe49408e8f625b658c393eb638bd81f Re-enable wakeup-on-signal for cache process. diff -r d8929af71fe4 -r 09e3134b649d stream/cache2.c --- a/stream/cache2.c Wed May 26 17:27:38 2010 +0000 +++ b/stream/cache2.c Wed May 26 17:56:11 2010 +0000 @@ -102,10 +102,7 @@ { #if FORKED_CACHE // signal process to wake up immediately - // Disabled for now since it causes incorrect EOFs - // due to interrupting read syscalls - this should be - // fixed instead though -// kill(s->cache_pid, SIGUSR1); + kill(s->cache_pid, SIGUSR1); #endif } @@ -356,11 +353,20 @@ int sleep_count = 0; do { if (!cache_fill(s)) { +#if FORKED_CACHE + // Let signal wake us up, we cannot leave this + // enabled since we do not handle EINTR in most places. + // This might need extra code to work on BSD. + signal(SIGUSR1, dummy_sighandler); +#endif if (sleep_count < INITIAL_FILL_USLEEP_COUNT) { sleep_count++; usec_sleep(INITIAL_FILL_USLEEP_TIME); } else usec_sleep(FILL_USLEEP_TIME); // idle +#if FORKED_CACHE + signal(SIGUSR1, SIG_IGN); +#endif } else sleep_count = 0; // cache_stats(s->cache_data); @@ -449,7 +455,6 @@ use_gui = 0; // mp_msg may not use gui stuff in forked code #endif signal(SIGTERM,exit_sighandler); // kill - signal(SIGUSR1, dummy_sighandler); // wakeup cache_mainloop(s); // make sure forked code never leaves this function exit(0);