Index: /orxonox/branches/updater/configure
===================================================================
--- /orxonox/branches/updater/configure	(revision 3271)
+++ /orxonox/branches/updater/configure	(revision 3272)
@@ -6969,9 +6969,70 @@
 
 
-#checking for pthread libs
-# AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
-# if test "$FOUND_pthread" = "yes" ; then
-#    LIBS="$LIBS -lpthread"
-# fi
+checking for pthread libs
+echo "$as_me:$LINENO: checking for main in -lpthread" >&5
+echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+	 { ac_try='test -z "$ac_c_werror_flag"
+			 || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+	 { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6
+if test $ac_cv_lib_pthread_main = yes; then
+  FOUND_pthread=yes
+fi
+
+ if test "$FOUND_pthread" = "yes" ; then
+    LIBS="$LIBS -lpthread"
+ fi
 
 
Index: /orxonox/branches/updater/configure.ac
===================================================================
--- /orxonox/branches/updater/configure.ac	(revision 3271)
+++ /orxonox/branches/updater/configure.ac	(revision 3272)
@@ -403,9 +403,9 @@
 
 
-#checking for pthread libs
-# AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
-# if test "$FOUND_pthread" = "yes" ; then
-#    LIBS="$LIBS -lpthread"
-# fi
+checking for pthread libs
+AC_CHECK_LIB([pthread], [main], FOUND_pthread=yes)
+ if test "$FOUND_pthread" = "yes" ; then
+    LIBS="$LIBS -lpthread"
+ fi
 
 
Index: /orxonox/branches/updater/src/gui/orxonox_gui_update.cc
===================================================================
--- /orxonox/branches/updater/src/gui/orxonox_gui_update.cc	(revision 3271)
+++ /orxonox/branches/updater/src/gui/orxonox_gui_update.cc	(revision 3272)
@@ -201,5 +201,6 @@
 
 CURL* OrxonoxGuiUpdate::curlHandle = NULL;
-GThread* OrxonoxGuiUpdate::downloadThreadID = NULL;
+pthread_t* OrxonoxGuiUpdate::downloadThreadID = new pthread_t;
+bool OrxonoxGuiUpdate::isDownloading = false;
 
 void* OrxonoxGuiUpdate::download (void* fileInfo)
@@ -209,5 +210,4 @@
   FileInfo* info = (FileInfo*)fileInfo;
   CURLcode res;
-  FILE* outfile;
   curlHandle = curl_easy_init();
   char* fileOnNet = new char [strlen(info->webRoot)+strlen(info->fileName)+1];
@@ -217,12 +217,12 @@
   strcpy (fileOnDisk, info->localRoot);
   strcat (fileOnDisk, info->fileName);
-
+  pthread_t test;
   if(curlHandle)
     {
       
-      outfile = fopen(fileOnDisk, "w");
+      info->fileHandle = fopen(fileOnDisk, "w");
 
       curl_easy_setopt(curlHandle, CURLOPT_URL, fileOnNet);
-      curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, outfile);
+      curl_easy_setopt(curlHandle, CURLOPT_WRITEDATA, info->fileHandle);
       curl_easy_setopt(curlHandle, CURLOPT_WRITEFUNCTION, curlWriteFunc);
       curl_easy_setopt(curlHandle, CURLOPT_READFUNCTION, curlReadFunc);
@@ -231,37 +231,33 @@
       curl_easy_setopt(curlHandle, CURLOPT_PROGRESSDATA, info->Bar);
 
-      if (!downloadThreadID)
+      if (!isDownloading)
 	{
 	  //! \todo check if threads really were created.
-	  downloadThreadID = g_thread_create(&downloadThread, info, TRUE, NULL);
-
-	  g_thread_create(&downloadThreadFinished, outfile, TRUE, NULL);
+	  pthread_create(downloadThreadID, NULL, downloadThread, info);
+	  //      else 
+	  //	PRINTF(1)("thread already in use\n");
+	  //      res = curl_easy_perform(curlHandle);
+	  
+	  //      fclose(outfile);
 	}
-      else 
-	PRINTF(1)("thread already in use\n");
-      //      res = curl_easy_perform(curlHandle);
-      
-      //      fclose(outfile);
     }
-  //  downloadThreadID = NULL;
   return NULL;
 }
 void* OrxonoxGuiUpdate::downloadThread(void* fileInfo)
 {
-  //  gdk_threads_enter();
+  isDownloading = true;
+
+  FileInfo* info = (FileInfo*)fileInfo;
   curl_easy_perform(curlHandle);
   if (curlHandle)
     curl_easy_cleanup(curlHandle);
-  gdk_threads_leave();
-  downloadThreadID = NULL;
-  //  g_thread_exit (NULL);
-}
-
-void* OrxonoxGuiUpdate::downloadThreadFinished(void* outfile)
-{
-  g_thread_join(downloadThreadID);
+
+  pthread_join(*downloadThreadID, NULL);
   PRINTF(3)("Closing the downloaded file.\n");
-  fclose((FILE*)outfile);
-}
+  fclose(info->fileHandle);
+
+  isDownloading = false;
+}
+
 
 #ifdef HAVE_GTK2
Index: /orxonox/branches/updater/src/gui/orxonox_gui_update.h
===================================================================
--- /orxonox/branches/updater/src/gui/orxonox_gui_update.h	(revision 3271)
+++ /orxonox/branches/updater/src/gui/orxonox_gui_update.h	(revision 3272)
@@ -14,4 +14,5 @@
 #include <curl/easy.h>
 #endif /* HAVE_CURL */
+#include <pthread.h>
 using namespace std;
 
@@ -50,4 +51,5 @@
     char* webRoot;        //!< The Root of the File on The Web
     char* localRoot;      //!< The Root directory to put the files on the local disk.
+    FILE* fileHandle;     //!< A fileHandler.
 
     ProgressBar* Bar;     //!< The ProgressBar, that sould be updated.
@@ -62,5 +64,7 @@
   static gint cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar);
 #endif /* HAVE_GTK2 */  
-  static GThread* downloadThreadID;
+  static pthread_t* downloadThreadID;
+  static bool isDownloading;
+
   static void* download (void* fileInfo);
   static void* downloadThread (void* fileInfo);
