gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r7156 - GNUnet/src/applications/fs/fsui
Date: Thu, 12 Jun 2008 10:46:38 -0600 (MDT)

Author: grothoff
Date: 2008-06-12 10:46:38 -0600 (Thu, 12 Jun 2008)
New Revision: 7156

Modified:
   GNUnet/src/applications/fs/fsui/deserialize.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsui.h
   GNUnet/src/applications/fs/fsui/search.c
Log:
fixing deadlock

Modified: GNUnet/src/applications/fs/fsui/deserialize.c
===================================================================
--- GNUnet/src/applications/fs/fsui/deserialize.c       2008-06-12 13:45:27 UTC 
(rev 7155)
+++ GNUnet/src/applications/fs/fsui/deserialize.c       2008-06-12 16:46:38 UTC 
(rev 7156)
@@ -598,7 +598,6 @@
         return GNUNET_OK;
       list = GNUNET_malloc (sizeof (GNUNET_FSUI_SearchList));
       memset (list, 0, sizeof (GNUNET_FSUI_SearchList));
-      list->lock = GNUNET_mutex_create (GNUNET_NO);
       list->ctx = ctx;
       if ((GNUNET_OK != read_int (rb, (int *) &list->state)) ||
           (GNUNET_OK != read_long (rb, (long long *) &list->start_time)) ||
@@ -688,7 +687,6 @@
     }
   if (list->uri != NULL)
     GNUNET_ECRS_uri_destroy (list->uri);
-  GNUNET_mutex_destroy (list->lock);
   GNUNET_free (list);
   return GNUNET_SYSERR;
 }

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2008-06-12 13:45:27 UTC (rev 
7155)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2008-06-12 16:46:38 UTC (rev 
7156)
@@ -94,7 +94,6 @@
   sl = ctx->activeSearches;
   while (sl != NULL)
     {
-      GNUNET_mutex_lock (sl->lock);
       srl = sl->resultsReceived;
       while (srl != NULL)
         {
@@ -195,7 +194,6 @@
 
           srl = srl->next;
         }
-      GNUNET_mutex_unlock (sl->lock);
       sl = sl->next;
     }
   GNUNET_mutex_unlock (ctx->lock);

Modified: GNUnet/src/applications/fs/fsui/fsui.h
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.h      2008-06-12 13:45:27 UTC (rev 
7155)
+++ GNUnet/src/applications/fs/fsui/fsui.h      2008-06-12 16:46:38 UTC (rev 
7156)
@@ -156,11 +156,6 @@
   GNUNET_CronTime start_time;
 
   /**
-   * Lock for the search.
-   */
-  struct GNUNET_Mutex *lock;
-
-  /**
    * Searches are kept in a simple linked list.
    */
   struct GNUNET_FSUI_SearchList *next;

Modified: GNUnet/src/applications/fs/fsui/search.c
===================================================================
--- GNUnet/src/applications/fs/fsui/search.c    2008-06-12 13:45:27 UTC (rev 
7155)
+++ GNUnet/src/applications/fs/fsui/search.c    2008-06-12 16:46:38 UTC (rev 
7156)
@@ -100,7 +100,6 @@
       GNUNET_pseudonym_add (ectx, pos->ctx->cfg, &nsid, fi->meta);
       return GNUNET_OK;
     }
-  GNUNET_mutex_lock (pos->lock);
   srl = pos->resultsReceived;
   while (srl != NULL)
     {
@@ -117,7 +116,6 @@
                   fprintf (stderr,
                            "Received search result that I have seen 
before.\n");
 #endif
-                  GNUNET_mutex_unlock (pos->lock);
                   return GNUNET_OK;     /* seen before */
                 }
             }
@@ -129,7 +127,6 @@
           if (rec == NULL)
             {
               GNUNET_GE_BREAK (NULL, 0);
-              GNUNET_mutex_unlock (pos->lock);
               return GNUNET_OK; /* should have matching search */
             }
           GNUNET_array_append (srl->matchingSearches,
@@ -159,7 +156,6 @@
 #endif
               processResult (pos, srl, update);
             }
-          GNUNET_mutex_unlock (pos->lock);
           return GNUNET_OK;
         }
       srl = srl->next;
@@ -173,7 +169,6 @@
   if (rec == NULL)
     {
       GNUNET_GE_BREAK (NULL, 0);
-      GNUNET_mutex_unlock (pos->lock);
       return GNUNET_OK;         /* should have matching search */
     }
   srl = GNUNET_malloc (sizeof (struct SearchResultList));
@@ -207,7 +202,6 @@
 #endif
       processResult (pos, srl, 0);
     }
-  GNUNET_mutex_unlock (pos->lock);
   return GNUNET_OK;
 }
 
@@ -285,14 +279,12 @@
   pos->ctx = ctx;
   pos->start_time = GNUNET_get_time ();
   pos->uri = GNUNET_ECRS_uri_duplicate (uri);
-  pos->lock = GNUNET_mutex_create (GNUNET_NO);
   event.type = GNUNET_FSUI_search_started;
   event.data.SearchStarted.sc.pos = pos;
   event.data.SearchStarted.sc.cctx = NULL;
   event.data.SearchStarted.searchURI = pos->uri;
   event.data.SearchStarted.anonymityLevel = pos->anonymityLevel;
   pos->cctx = pos->ctx->ecb (pos->ctx->ecbClosure, &event);
-  GNUNET_mutex_lock (pos->lock);
   if (GNUNET_ECRS_uri_test_ksk (uri))
     {
       /* (possibly boolean) keyword search */
@@ -341,12 +333,9 @@
       event.data.SearchStopped.sc.cctx = NULL;
       pos->cctx = pos->ctx->ecb (pos->ctx->ecbClosure, &event);
       GNUNET_ECRS_uri_destroy (pos->uri);
-      GNUNET_mutex_unlock (pos->lock);
-      GNUNET_mutex_destroy (pos->lock);
       GNUNET_free (pos);
       return NULL;
     }
-  GNUNET_mutex_unlock (pos->lock);
   /* success, add to FSUI state */
   GNUNET_mutex_lock (ctx->lock);
   pos->next = ctx->activeSearches;
@@ -575,7 +564,6 @@
         }
       GNUNET_free (srl);
     }
-  GNUNET_mutex_destroy (pos->lock);
   if (pos->probe_context != NULL)
     GNUNET_FS_destroy_search_context (pos->probe_context);
   GNUNET_free (pos);





reply via email to

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