[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10227 - GNUnet/src/applications/dv_dht/module
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10227 - GNUnet/src/applications/dv_dht/module |
Date: |
Fri, 5 Feb 2010 16:21:03 +0100 |
Author: nevans
Date: 2010-02-05 16:21:03 +0100 (Fri, 05 Feb 2010)
New Revision: 10227
Modified:
GNUnet/src/applications/dv_dht/module/routing.c
GNUnet/src/applications/dv_dht/module/table.c
Log:
perhaps a better locking fix...
Modified: GNUnet/src/applications/dv_dht/module/routing.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/routing.c 2010-02-05 15:10:57 UTC
(rev 10226)
+++ GNUnet/src/applications/dv_dht/module/routing.c 2010-02-05 15:21:03 UTC
(rev 10227)
@@ -1392,9 +1392,7 @@
put->type = htonl (type);
put->hop_count = htonl (0);
memset (&put->bloomfilter, 0, DV_DHT_BLOOM_SIZE);
- GNUNET_mutex_lock(lock);
put->network_size = htonl (GNUNET_DV_DHT_estimate_network_diameter ());
- GNUNET_mutex_unlock(lock);
#if DEBUG_ROUTING
queryuid = 0;
GNUNET_GE_LOG (coreAPI->ectx,
Modified: GNUnet/src/applications/dv_dht/module/table.c
===================================================================
--- GNUnet/src/applications/dv_dht/module/table.c 2010-02-05 15:10:57 UTC
(rev 10226)
+++ GNUnet/src/applications/dv_dht/module/table.c 2010-02-05 15:21:03 UTC
(rev 10227)
@@ -269,11 +269,14 @@
GNUNET_DV_DHT_estimate_network_diameter ()
{
unsigned int i;
-
+ GNUNET_mutex_lock(lock);
for (i = bucketCount - 1; i > 0; i--)
if (buckets[i].peers_size > 0)
break;
+
+ GNUNET_mutex_unlock(lock);
return i + 1;
+
}
/**
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10227 - GNUnet/src/applications/dv_dht/module,
gnunet <=