Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4061 in orxonox.OLD for orxonox/trunk/src/lib/gui


Ignore:
Timestamp:
May 5, 2005, 3:10:03 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: no more multi-Threading-support… maybe again in the future, who knows

Location:
orxonox/trunk/src/lib/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/Makefile.in

    r4054 r4061  
    8989EXEEXT = @EXEEXT@
    9090GPROF = @GPROF@
    91 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    92 GTHREAD_LIBS = @GTHREAD_LIBS@
    9391GTK2_CFLAGS = @GTK2_CFLAGS@
    9492GTK2_LIBS = @GTK2_LIBS@
    9593HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    9694HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    97 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    98 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    9995HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    10096HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • orxonox/trunk/src/lib/gui/console/Makefile.in

    r4054 r4061  
    107107EXEEXT = @EXEEXT@
    108108GPROF = @GPROF@
    109 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    110 GTHREAD_LIBS = @GTHREAD_LIBS@
    111109GTK2_CFLAGS = @GTK2_CFLAGS@
    112110GTK2_LIBS = @GTK2_LIBS@
    113111HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    114112HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    115 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    116 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    117113HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    118114HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • orxonox/trunk/src/lib/gui/gui/Makefile.in

    r4054 r4061  
    112112EXEEXT = @EXEEXT@
    113113GPROF = @GPROF@
    114 GTHREAD_CFLAGS = @GTHREAD_CFLAGS@
    115 GTHREAD_LIBS = @GTHREAD_LIBS@
    116114GTK2_CFLAGS = @GTK2_CFLAGS@
    117115GTK2_LIBS = @GTK2_LIBS@
    118116HAVE_CURL_FALSE = @HAVE_CURL_FALSE@
    119117HAVE_CURL_TRUE = @HAVE_CURL_TRUE@
    120 HAVE_GTHREAD_FALSE = @HAVE_GTHREAD_FALSE@
    121 HAVE_GTHREAD_TRUE = @HAVE_GTHREAD_TRUE@
    122118HAVE_GTK2_FALSE = @HAVE_GTK2_FALSE@
    123119HAVE_GTK2_TRUE = @HAVE_GTK2_TRUE@
  • orxonox/trunk/src/lib/gui/gui/gui_gtk.cc

    r4058 r4061  
    4949
    5050#ifdef HAVE_GTK2
    51 #ifdef HAVE_GTHREAD
    52   PRINTF(4)("Initializing the ThreadSystem of the GUI\n");
    53   g_thread_init(NULL);
    54   gdk_threads_init();
    55 #endif /* HAVE_GTHREAD */
    5651  gtk_init(&argc, &argv);
    5752#include "rc"
     
    6661{
    6762#ifdef HAVE_GTK2
    68   gdk_threads_enter();
    6963  gtk_main();
    70   gdk_threads_leave();
    71   delete Window::mainWindow;
    7264#else /* HAVE_GTK2 */
    7365  char boolAns = 'y';
  • orxonox/trunk/src/lib/gui/gui/gui_update.cc

    r4056 r4061  
    276276  bar->setTotalSize(totalSize);
    277277#ifdef HAVE_GTK2
    278 #ifndef HAVE_PTHREAD_H
    279278  while(gtk_events_pending()) gtk_main_iteration();
    280279#endif
    281 #endif
    282280  return 0;
    283281}
     
    288286CURL* GuiUpdate::curlHandle = NULL;
    289287
    290 #ifdef HAVE_PTHREAD_H
    291 /** \brief The download Thread ID */
    292 pthread_t* GuiUpdate::downloadThreadID = new pthread_t;
    293 /**   \brief The download Thread ID*/
    294 pthread_t* GuiUpdate::downloadThreadFinishID = new pthread_t;
    295 #endif /* HAVE_PTHREAD_H */
    296288/**
    297289   \brief A bool parameter that shows if we are downloading.
     
    387379      if(!isDownloading)
    388380        {
    389 #ifdef HAVE_PTHREAD_H     
    390           pthread_join(*downloadThreadFinishID, NULL);
    391 #endif /* HAVE_PTHREAD_H */
    392381#ifdef HAVE_GTK2
    393382          info->stateButton->disconnectSignal(info->buttonSignal);
    394383          info->buttonSignal = info->stateButton->connectSignal("button_press_event", info, cancelDownload);
    395384#endif /* HAVE_GTK2 */
    396 #ifdef HAVE_PTHREAD_H
    397           info->stateButton->setTitle("cancel");
    398 #else /* HAVE_PTHREAD_H */
    399385          info->stateButton->setTitle("please wait");
    400 #endif /* HAVE_PTHREAD_H */
    401386         
    402           //! \todo check if threads really were created.
    403 #ifdef HAVE_PTHREAD_H
    404           pthread_create(downloadThreadID, NULL, downloadThread, info);
    405           pthread_create(downloadThreadFinishID, NULL, downloadThreadFinished, info); 
    406 #else
    407387          downloadThread(info);
    408388          downloadThreadFinished(info);
    409 #endif /* HAVE_PTHREAD_H */
    410389         
    411390          //      res = curl_easy_perform(curlHandle);
     
    439418{
    440419  FileInfo* info =(FileInfo*)fileInfo;
    441 #ifdef HAVE_PTHREAD_H
    442   pthread_join(*downloadThreadID, NULL);
    443 #ifdef HAVE_GTK2
    444   gdk_threads_enter();
    445 #endif /* HAVE_GTK2 */
    446 #endif /* HAVE_PTHREAD_H */
    447420  if(curlHandle)
    448421    curl_easy_cleanup(curlHandle);
     
    460433#endif /* HAVE_GTK2 */
    461434  isDownloading = false;
    462 #ifdef HAVE_PTHREAD_H
    463 #ifdef HAVE_GTK2
    464   gdk_threads_leave();
    465 #endif /* HAVE_GTK2 */
    466 #endif /* HAVE_PTHREAD_H */
    467435
    468436}
     
    479447gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
    480448{
    481 #ifdef HAVE_PTHREAD_H
    482   pthread_cancel(*downloadThreadID);
    483 #else
    484   PRINTF(2)("Cannot cancle the Downloading process until after this File, because no threading was enabled\n");
    485 #endif /* HAVE_PTHREAD_H*/
     449  PRINTF(4)("Cannot cancle the Downloading process until after this File\n");
    486450}
    487451#endif /* HAVE_GTK2 */
  • orxonox/trunk/src/lib/gui/gui/gui_update.h

    r4056 r4061  
    8282  static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
    8383#endif /* HAVE_GTK2 */ 
    84 #ifdef HAVE_PTHREAD_H
    85   static pthread_t* downloadThreadID;
    86   static pthread_t* downloadThreadFinishID;
    87 #endif /* HAVE_PTHREAD_H */
    8884  static bool isDownloading;
     85  static bool downloadCanceled;
    8986
    9087  static bool download(void* fileInfo);
Note: See TracChangeset for help on using the changeset viewer.