Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.