aboutsummaryrefslogtreecommitdiff
path: root/src/lockmanager
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-06-20 14:18:02 +0000
committerChristian Grothoff <christian@grothoff.org>2012-06-20 14:18:02 +0000
commitc5576791b6963e7375b25574e2fdcd2c216bc04d (patch)
tree5c743709a1a62b2e14e2b91c6f78768ee3cbc6ff /src/lockmanager
parent2bf0f807581d047b20addd91d808dd94f8fa1d97 (diff)
downloadgnunet-c5576791b6963e7375b25574e2fdcd2c216bc04d.tar.gz
gnunet-c5576791b6963e7375b25574e2fdcd2c216bc04d.zip
-ideas for stuff
Diffstat (limited to 'src/lockmanager')
-rw-r--r--src/lockmanager/lockmanager_api.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/lockmanager/lockmanager_api.c b/src/lockmanager/lockmanager_api.c
index 2d2c75d50..bfdb2c182 100644
--- a/src/lockmanager/lockmanager_api.c
+++ b/src/lockmanager/lockmanager_api.c
@@ -68,6 +68,12 @@ struct MessageQueue
68 * The LOCKMANAGER Message 68 * The LOCKMANAGER Message
69 */ 69 */
70 struct GNUNET_LOCKMANAGER_Message *msg; 70 struct GNUNET_LOCKMANAGER_Message *msg;
71
72 /**
73 * If this is a AQUIRE_LOCK message, this is the
74 * affiliated locking request.
75 */
76 struct GNUNET_LOCKMANAGER_LockingRequest *lr;
71}; 77};
72 78
73 79
@@ -124,6 +130,12 @@ struct GNUNET_LOCKMANAGER_LockingRequest
124 GNUNET_LOCKMANAGER_StatusCallback status_cb; 130 GNUNET_LOCKMANAGER_StatusCallback status_cb;
125 131
126 /** 132 /**
133 * Entry in the request message queue for aquiring this
134 * lock; NULL after request has been sent.
135 */
136 struct MessageQueue *mqe;
137
138 /**
127 * Closure for the status callback 139 * Closure for the status callback
128 */ 140 */
129 void *status_cb_cls; 141 void *status_cb_cls;
@@ -678,16 +690,16 @@ GNUNET_LOCKMANAGER_acquire_lock (struct GNUNET_LOCKMANAGER_Handle *handle,
678 LOG (GNUNET_ERROR_TYPE_DEBUG, "Queueing ACQUIRE message\n"); 690 LOG (GNUNET_ERROR_TYPE_DEBUG, "Queueing ACQUIRE message\n");
679 queue_message (handle, msg); 691 queue_message (handle, msg);
680 get_key (r->domain, r->lock, &hash); 692 get_key (r->domain, r->lock, &hash);
681 GNUNET_CONTAINER_multihashmap_put (r->handle->hashmap, 693 GNUNET_assert (GNUNET_OK ==
682 &hash, 694 GNUNET_CONTAINER_multihashmap_put (r->handle->hashmap,
683 r, 695 &hash,
684 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE); 696 r,
697 GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE));
685 LOG (GNUNET_ERROR_TYPE_DEBUG, "%s() END\n", __func__); 698 LOG (GNUNET_ERROR_TYPE_DEBUG, "%s() END\n", __func__);
686 return r; 699 return r;
687} 700}
688 701
689 702
690
691/** 703/**
692 * Function to cancel the locking request generated by 704 * Function to cancel the locking request generated by
693 * GNUNET_LOCKMANAGER_acquire_lock. If the lock is acquired by us then the lock 705 * GNUNET_LOCKMANAGER_acquire_lock. If the lock is acquired by us then the lock