gnunet-svn
[Top][All Lists]
Advanced

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

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


From: grothoff
Subject: [GNUnet-SVN] r3820 - GNUnet/src/applications/fs/fsui
Date: Sat, 25 Nov 2006 16:32:15 -0800 (PST)

Author: grothoff
Date: 2006-11-25 16:32:13 -0800 (Sat, 25 Nov 2006)
New Revision: 3820

Modified:
   GNUnet/src/applications/fs/fsui/searchtest.c
Log:
fx

Modified: GNUnet/src/applications/fs/fsui/searchtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/searchtest.c        2006-11-25 20:54:05 UTC 
(rev 3819)
+++ GNUnet/src/applications/fs/fsui/searchtest.c        2006-11-26 00:32:13 UTC 
(rev 3820)
@@ -52,10 +52,13 @@
 
 static struct FSUI_Context * ctx;
 
+static struct MUTEX * lock;
+
 static void * eventCallback(void * cls,
                            const FSUI_Event * event) {
   static char unused;
 
+  MUTEX_LOCK(lock);
   switch(event->type) {
   case FSUI_search_resumed:
     search = event->data.SearchResumed.sc.pos;
@@ -66,6 +69,7 @@
   case FSUI_download_resumed:
   case FSUI_upload_resumed:
   case FSUI_unindex_resumed:
+    MUTEX_UNLOCK(lock);
     return &unused;
   case FSUI_search_result:
     printf("Received search result\n");
@@ -93,6 +97,7 @@
     break;
   }
   lastEvent = event->type;
+  MUTEX_UNLOCK(lock);
   return NULL;
 }
 
@@ -138,7 +143,7 @@
   PTHREAD_SLEEP(5 * cronSECONDS); /* give apps time to start */
   /* ACTUAL TEST CODE */
 #endif
-
+  lock = MUTEX_CREATE(NO);
   ctx = FSUI_start(NULL,
                   cfg,
                   "fsuisearchtest",
@@ -263,6 +268,8 @@
  FAILURE:
   if (ctx != NULL)
     FSUI_stop(ctx);
+  if (lock != NULL)
+    MUTEX_DESTROY(lock);
   FREENONNULL(fn);
   /* TODO: verify file 'fn(42)' == file 'fn(43)' */
   fn = makeName(42);





reply via email to

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