Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3273 in orxonox.OLD for orxonox/branches/updater/src/gui


Ignore:
Timestamp:
Dec 24, 2004, 9:43:22 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/updater: checking if pthread is an option

Location:
orxonox/branches/updater/src/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/Makefile.in

    r3271 r3273  
    232232          esac; \
    233233        done; \
    234         echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/gui/Makefile'; \
     234        echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/gui/Makefile'; \
    235235        cd $(top_srcdir) && \
    236           $(AUTOMAKE) --foreign  src/gui/Makefile
     236          $(AUTOMAKE) --gnu  src/gui/Makefile
    237237.PRECIOUS: Makefile
    238238Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/updater/src/gui/orxonox_gui_update.cc

    r3272 r3273  
    200200}
    201201
     202#ifdef HAVE_CURL
    202203CURL* OrxonoxGuiUpdate::curlHandle = NULL;
     204#endif /* HAVE_CURL */
     205
     206#ifdef HAVE_PTHREAD_H
    203207pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t;
     208#endif /* HAVE_PTHREAD_H */
    204209bool OrxonoxGuiUpdate::isDownloading = false;
    205210
     
    217222  strcpy (fileOnDisk, info->localRoot);
    218223  strcat (fileOnDisk, info->fileName);
    219   pthread_t test;
     224
    220225  if(curlHandle)
    221226    {
     
    234239        {
    235240          //! \todo check if threads really were created.
     241#ifdef HAVE_PTHREAD_H
    236242          pthread_create(downloadThreadID, NULL, downloadThread, info);
     243#else
     244          downloadThread(info);
     245#endif /* HAVE_PTHREAD_H */
     246         
    237247          //      else
    238248          //    PRINTF(1)("thread already in use\n");
     
    252262  if (curlHandle)
    253263    curl_easy_cleanup(curlHandle);
    254 
     264#ifdef HAVE_PTHREAD_H
    255265  pthread_join(*downloadThreadID, NULL);
     266#endif /* HAVE_PTHREAD_H */
    256267  PRINTF(3)("Closing the downloaded file.\n");
    257268  fclose(info->fileHandle);
  • orxonox/branches/updater/src/gui/orxonox_gui_update.h

    r3272 r3273  
    1414#include <curl/easy.h>
    1515#endif /* HAVE_CURL */
     16#ifdef HAVE_PTHREAD_H
    1617#include <pthread.h>
     18#endif /* HAVE_PTHREAD_H */
    1719using namespace std;
    1820
     
    6466  static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
    6567#endif /* HAVE_GTK2 */ 
     68#ifdef HAVE_PTHREAD_H
    6669  static pthread_t* downloadThreadID;
     70#endif /* HAVE_PTHREAD_H */
    6771  static bool isDownloading;
    6872
Note: See TracChangeset for help on using the changeset viewer.