[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6797 - GNUnet/src/applications/fs/lib
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6797 - GNUnet/src/applications/fs/lib |
Date: |
Sat, 10 May 2008 23:17:10 -0600 (MDT) |
Author: grothoff
Date: 2008-05-10 23:17:10 -0600 (Sat, 10 May 2008)
New Revision: 6797
Modified:
GNUnet/src/applications/fs/lib/fslib.c
GNUnet/src/applications/fs/lib/fslibtest.c
Log:
api change
Modified: GNUnet/src/applications/fs/lib/fslib.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslib.c 2008-05-11 05:16:49 UTC (rev
6796)
+++ GNUnet/src/applications/fs/lib/fslib.c 2008-05-11 05:17:10 UTC (rev
6797)
@@ -271,20 +271,19 @@
struct GNUNET_FS_SearchContext *
GNUNET_FS_create_search_context (struct GNUNET_GE_Context *ectx,
- struct GNUNET_GC_Configuration *cfg,
- struct GNUNET_Mutex *lock)
+ struct GNUNET_GC_Configuration *cfg)
{
struct GNUNET_FS_SearchContext *ret;
- GNUNET_GE_ASSERT (ectx, lock != NULL);
ret = GNUNET_malloc (sizeof (struct GNUNET_FS_SearchContext));
memset (ret, 0, sizeof (struct GNUNET_FS_SearchContext));
ret->ectx = ectx;
ret->cfg = cfg;
- ret->lock = lock;
+ ret->lock = GNUNET_mutex_create(GNUNET_YES);
ret->sock = GNUNET_client_connection_create (ectx, cfg);
if (ret->sock == NULL)
{
+ GNUNET_mutex_destroy(ret->lock);
GNUNET_free (ret);
return NULL;
}
@@ -304,13 +303,10 @@
void *unused;
struct GNUNET_FS_SearchHandle *pos;
- GNUNET_mutex_lock (ctx->lock);
ctx->abort = GNUNET_YES;
GNUNET_client_connection_close_forever (ctx->sock);
- GNUNET_mutex_unlock (ctx->lock);
GNUNET_thread_stop_sleep (ctx->thread);
GNUNET_thread_join (ctx->thread, &unused);
- ctx->lock = NULL;
GNUNET_client_connection_destroy (ctx->sock);
while (ctx->handles != NULL)
{
@@ -318,6 +314,7 @@
ctx->handles = pos->next;
GNUNET_free (pos);
}
+ GNUNET_mutex_destroy(ctx->lock);
GNUNET_free (ctx);
}
Modified: GNUnet/src/applications/fs/lib/fslibtest.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslibtest.c 2008-05-11 05:16:49 UTC (rev
6796)
+++ GNUnet/src/applications/fs/lib/fslibtest.c 2008-05-11 05:17:10 UTC (rev
6797)
@@ -38,8 +38,6 @@
static struct GNUNET_ThreadHandle *mainThread;
-static struct GNUNET_Mutex *lock;
-
static struct GNUNET_GC_Configuration *cfg;
@@ -179,7 +177,7 @@
GNUNET_EC_DBlock *db;
struct GNUNET_FS_SearchContext *ctx;
- ctx = GNUNET_FS_create_search_context (NULL, cfg, lock);
+ ctx = GNUNET_FS_create_search_context (NULL, cfg);
dv = makeBlock (i);
db = (GNUNET_EC_DBlock *) & dv[1];
GNUNET_EC_file_block_get_query (db,
@@ -238,7 +236,6 @@
#endif
ok = GNUNET_YES;
GNUNET_cron_start (cron);
- lock = GNUNET_mutex_create (GNUNET_NO);
#if START_DAEMON
GNUNET_GE_ASSERT (NULL,
GNUNET_OK == GNUNET_wait_for_daemon_running (NULL, cfg,
@@ -337,7 +334,7 @@
block = NULL;
i = 2;
mainThread = GNUNET_thread_get_self ();
- ctx = GNUNET_FS_create_search_context (NULL, cfg, lock);
+ ctx = GNUNET_FS_create_search_context (NULL, cfg);
GNUNET_FS_start_search (ctx,
NULL,
GNUNET_ECRS_BLOCKTYPE_ANY,
@@ -354,7 +351,6 @@
fprintf (stderr, "\n");
if (sock != NULL)
GNUNET_client_connection_destroy (sock);
- GNUNET_mutex_destroy (lock);
GNUNET_cron_stop (cron);
GNUNET_cron_destroy (cron);
GNUNET_free_non_null (block);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6797 - GNUnet/src/applications/fs/lib,
gnunet <=