changeset 31145:47d2e52f61b4

Try reducing the #ifdef mess for the different cache variants.
author reimar
date Sun, 23 May 2010 22:04:01 +0000
parents c2d5a1f6360b
children 78d11e186bfc
files stream/cache2.c
diffstat 1 files changed, 13 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/stream/cache2.c	Sun May 23 21:58:50 2010 +0000
+++ b/stream/cache2.c	Sun May 23 22:04:01 2010 +0000
@@ -439,32 +439,30 @@
     return res;
   }
 
-#if defined(__MINGW32__) || defined(PTHREAD_CACHE) || defined(__OS2__)
-}
-#ifdef PTHREAD_CACHE
-static void *ThreadProc( void *s ){
-#else
-static void ThreadProc( void *s ){
-#endif
-#endif
-
+#if !defined(__MINGW32__) && !defined(PTHREAD_CACHE) && !defined(__OS2__)
 #ifdef CONFIG_GUI
   use_gui = 0; // mp_msg may not use gui stuff in forked code
 #endif
-// cache thread mainloop:
   signal(SIGTERM,exit_sighandler); // kill
   signal(SIGUSR1, dummy_sighandler); // wakeup
   cache_mainloop(s);
-#if defined(__MINGW32__) || defined(__OS2__)
-  _endthread();
-#elif defined(PTHREAD_CACHE)
-  return NULL;
-#else
   // make sure forked code never leaves this function
   exit(0);
 #endif
 }
 
+#ifdef PTHREAD_CACHE
+static void *ThreadProc( void *s ){
+  cache_mainloop(s);
+  return NULL;
+}
+#elif defined(__MINGW32__) || defined(__OS2__)
+static void ThreadProc( void *s ){
+  cache_mainloop(s);
+  _endthread();
+}
+#endif
+
 int cache_stream_fill_buffer(stream_t *s){
   int len;
   if(s->eof){ s->buf_pos=s->buf_len=0; return 0; }