gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6790 - GNUnet/src/applications/fs/fsui


From: gnunet
Subject: [GNUnet-SVN] r6790 - GNUnet/src/applications/fs/fsui
Date: Wed, 7 May 2008 20:38:11 -0600 (MDT)

Author: grothoff
Date: 2008-05-07 20:38:10 -0600 (Wed, 07 May 2008)
New Revision: 6790

Modified:
   GNUnet/src/applications/fs/fsui/fsui.c
Log:
fixing order

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2008-05-07 15:02:04 UTC (rev 
6789)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2008-05-08 02:38:10 UTC (rev 
6790)
@@ -454,30 +454,7 @@
 
   /* 3) restart processing */
   ret->cron = GNUNET_cron_create (ectx);
-  /* 3a) resume downloads */
-  GNUNET_cron_add_job (ret->cron,
-                       &updateDownloadThreads, 0, GNUNET_FSUI_UDT_FREQUENCY,
-                       ret);
-  GNUNET_cron_start (ret->cron);
-  /* 3b) resume uploads */
-  doResumeUploads (ret->activeUploads.child, ret);
-  /* 3c) resume unindexing */
-  xlist = ret->unindexOperations;
-  while (xlist != NULL)
-    {
-      if (xlist->state == GNUNET_FSUI_PENDING)
-        {
-          xlist->state = GNUNET_FSUI_ACTIVE;
-          xlist->handle = GNUNET_thread_create (&GNUNET_FSUI_unindexThread,
-                                                xlist, 32 * 1024);
-          if (xlist->handle == NULL)
-            GNUNET_GE_DIE_STRERROR (ectx,
-                                    GNUNET_GE_FATAL | GNUNET_GE_ADMIN |
-                                    GNUNET_GE_IMMEDIATE, "pthread_create");
-        }
-      xlist = xlist->next;
-    }
-  /* 3d) resume searching */
+  /* 3a) resume searching */
   list = ret->activeSearches;
   while (list != NULL)
     {
@@ -520,7 +497,29 @@
         }
       list = list->next;
     }
-
+  /* 3b) resume unindexing */
+  xlist = ret->unindexOperations;
+  while (xlist != NULL)
+    {
+      if (xlist->state == GNUNET_FSUI_PENDING)
+        {
+          xlist->state = GNUNET_FSUI_ACTIVE;
+          xlist->handle = GNUNET_thread_create (&GNUNET_FSUI_unindexThread,
+                                                xlist, 32 * 1024);
+          if (xlist->handle == NULL)
+            GNUNET_GE_DIE_STRERROR (ectx,
+                                    GNUNET_GE_FATAL | GNUNET_GE_ADMIN |
+                                    GNUNET_GE_IMMEDIATE, "pthread_create");
+        }
+      xlist = xlist->next;
+    }
+  /* 3c) resume downloads */
+  GNUNET_cron_add_job (ret->cron,
+                       &updateDownloadThreads, 0, GNUNET_FSUI_UDT_FREQUENCY,
+                       ret);
+  GNUNET_cron_start (ret->cron);
+  /* 3d) resume uploads */
+  doResumeUploads (ret->activeUploads.child, ret);
   return ret;
 }
 
@@ -743,21 +742,11 @@
     }
 
   /* 2) signal suspension events */
-  /* 2a) signal search suspension */
-  spos = ctx->activeSearches;
-  while (spos != NULL)
-    {
-      event.type = GNUNET_FSUI_search_suspended;
-      event.data.SearchSuspended.sc.pos = spos;
-      event.data.SearchSuspended.sc.cctx = spos->cctx;
-      ctx->ecb (ctx->ecbClosure, &event);
-      spos = spos->next;
-    }
-  /* 2b) signal uploads suspension */
+  /* 2a) signal uploads suspension */
   signalUploadSuspend (ectx, ctx, ctx->activeUploads.child);
-  /* 2c) signal downloads suspension */
+  /* 2b) signal downloads suspension */
   signalDownloadSuspend (ectx, ctx, ctx->activeDownloads.child);
-  /* 2d) signal unindex suspension */
+  /* 2c) signal unindex suspension */
   xpos = ctx->unindexOperations;
   while (xpos != NULL)
     {
@@ -767,6 +756,16 @@
       ctx->ecb (ctx->ecbClosure, &event);
       xpos = xpos->next;
     }
+  /* 2d) signal search suspension */
+  spos = ctx->activeSearches;
+  while (spos != NULL)
+    {
+      event.type = GNUNET_FSUI_search_suspended;
+      event.data.SearchSuspended.sc.pos = spos;
+      event.data.SearchSuspended.sc.cctx = spos->cctx;
+      ctx->ecb (ctx->ecbClosure, &event);
+      spos = spos->next;
+    }
 
   /* 3) serialize all of the FSUI state */
   if (ctx->ipc != NULL)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]