gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r6249 - GNUnet/src/applications/datastore


From: gnunet
Subject: [GNUnet-SVN] r6249 - GNUnet/src/applications/datastore
Date: Sun, 10 Feb 2008 23:11:08 -0700 (MST)

Author: grothoff
Date: 2008-02-10 23:11:08 -0700 (Sun, 10 Feb 2008)
New Revision: 6249

Modified:
   GNUnet/src/applications/datastore/prefetch.c
Log:
start lazy

Modified: GNUnet/src/applications/datastore/prefetch.c
===================================================================
--- GNUnet/src/applications/datastore/prefetch.c        2008-02-11 06:10:51 UTC 
(rev 6248)
+++ GNUnet/src/applications/datastore/prefetch.c        2008-02-11 06:11:08 UTC 
(rev 6249)
@@ -117,6 +117,14 @@
 getRandom (GNUNET_HashCode * key, GNUNET_DatastoreValue ** value)
 {
   GNUNET_mutex_lock (lock);
+  if (gather_thread == NULL)
+    {
+      gather_thread = GNUNET_thread_create (&rcbAcquire, NULL, 64 * 1024);
+      if (gather_thread == NULL)
+       GNUNET_GE_LOG_STRERROR (ectx,
+                               GNUNET_GE_ERROR | GNUNET_GE_ADMIN | 
GNUNET_GE_USER
+                               | GNUNET_GE_IMMEDIATE, "pthread_create");
+    }    
   if (rvalue == NULL)
     {
       GNUNET_mutex_unlock (lock);
@@ -141,11 +149,6 @@
   acquireMoreSignal = GNUNET_semaphore_create (1);
   doneSignal = GNUNET_NO;
   lock = GNUNET_mutex_create (GNUNET_NO);
-  gather_thread = GNUNET_thread_create (&rcbAcquire, NULL, 64 * 1024);
-  if (gather_thread == NULL)
-    GNUNET_GE_LOG_STRERROR (ectx,
-                            GNUNET_GE_ERROR | GNUNET_GE_ADMIN | GNUNET_GE_USER
-                            | GNUNET_GE_IMMEDIATE, "pthread_create");
 }
 
 void





reply via email to

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