[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xine-cvslog
Subject:    [xine-cvs] HG: xine-ui: Backed out changeset 78a115bef290.
From:       Darren Salt <linux () youmustbejoking ! demon ! co ! uk>
Date:       2010-07-20 20:00:24
Message-ID: c887d522772bd4dfad3d.1279655947 () hg ! debian ! org
[Download RAW message or body]

# HG changeset patch
# User Darren Salt <linux@youmustbejoking.demon.co.uk>
# Date 1279655947 -3600
# Node ID c887d522772bd4dfad3d59c39247c2e3ed29f2ac
# Parent  78a115bef2902a82ed183fd2a931eb10efefed57
Backed out changeset 78a115bef290. gui_exit() from another thread 'fails'.

diff --git a/src/xitk/actions.c b/src/xitk/actions.c
--- a/src/xitk/actions.c
+++ b/src/xitk/actions.c
@@ -647,9 +647,6 @@
  * Callback-functions for widget-button click
  */
 void gui_exit (xitk_widget_t *w, void *data) {
-
-  if (gui_fire_exit_handler())
-    return;
 
   oxine_exit();
 
diff --git a/src/xitk/common.h b/src/xitk/common.h
--- a/src/xitk/common.h
+++ b/src/xitk/common.h
@@ -380,20 +380,7 @@
 
   FILE                      *orig_stdout; /* original stdout at startup        */
                                           /* before an evtl. later redirection */
-
-  /*
-   * there are several threads that call gui_exit() and cause all sorts of
-   * deadlocks and memory corruption, so only a whole redesign could fix that
-   * introducing a new independent thread for executing that code seems easier
-   */
-  pthread_mutex_t            gui_exit_handler_mutex;
-  pthread_cond_t             gui_exit_handler_cond;
-  pthread_t                  gui_exit_handler_thread;
-  int                        gui_exit_handler_fired;
-  
 } gGui_t;
-
-int gui_fire_exit_handler(void);
 
 extern gGui_t *gGui;
 
diff --git a/src/xitk/main.c b/src/xitk/main.c
--- a/src/xitk/main.c
+++ b/src/xitk/main.c
@@ -1373,54 +1373,6 @@
     break;
 
   }
-}
-
-static void *gui_exit_handler(void *arg)
-{
-  int fired;
-
-  pthread_mutex_lock(&gGui->gui_exit_handler_mutex);
-  pthread_cond_wait(&gGui->gui_exit_handler_cond, &gGui->gui_exit_handler_mutex);
-  fired = gGui->gui_exit_handler_fired;
-  pthread_mutex_unlock(&gGui->gui_exit_handler_mutex);
-
-  if (fired)
-    gui_exit(NULL, NULL);
-
-  return NULL;
-}
-
-static void gui_fork_exit_handler(void)
-{
-  gGui->gui_exit_handler_fired = 0;
-  pthread_mutex_init(&gGui->gui_exit_handler_mutex, NULL);
-  pthread_cond_init(&gGui->gui_exit_handler_cond, NULL);
-  pthread_create(&gGui->gui_exit_handler_thread, NULL, gui_exit_handler, NULL);
-}
-
-int gui_fire_exit_handler(void)
-{
-  if (pthread_self() == gGui->gui_exit_handler_thread)
-    return 0;
-
-  pthread_mutex_lock(&gGui->gui_exit_handler_mutex);
-  gGui->gui_exit_handler_fired = 1;
-  pthread_cond_broadcast(&gGui->gui_exit_handler_cond);
-  pthread_mutex_unlock(&gGui->gui_exit_handler_mutex);
-
-  return 1;
-}
-
-static void gui_join_exit_handler(void)
-{
-  pthread_mutex_lock(&gGui->gui_exit_handler_mutex);
-  pthread_cond_broadcast(&gGui->gui_exit_handler_cond);
-  pthread_mutex_unlock(&gGui->gui_exit_handler_mutex);
-
-  pthread_join(gGui->gui_exit_handler_thread, NULL);
-
-  pthread_cond_destroy(&gGui->gui_exit_handler_cond);
-  pthread_mutex_destroy(&gGui->gui_exit_handler_mutex);
 }
   
 /*
@@ -2118,7 +2070,6 @@
   /*
    * init gui
    */
-  gui_fork_exit_handler();
   gui_init(_argc - optind, &_argv[optind], &window_attribute);
 
   pthread_mutex_init(&gGui->download_mutex, NULL);
@@ -2324,7 +2275,6 @@
   }
 
   gui_run(session_argv);
-  gui_join_exit_handler();
 
   visual_anim_done();
   free(pplugins);

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic