X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftestbed%2Ftestbed_api_operations.h;h=e78ed0fcc1324a11043acbe25f47ebf24d59f204;hb=f4d040c0f0dd2fef3d73b1f4532c76219f760f75;hp=92f5644c90c0ae70dde2074c58995ab9eafd68f7;hpb=05f1e97c640e63ad39887ec698fdf8f905cbf316;p=oweals%2Fgnunet.git diff --git a/src/testbed/testbed_api_operations.h b/src/testbed/testbed_api_operations.h index 92f5644c9..e78ed0fcc 100644 --- a/src/testbed/testbed_api_operations.h +++ b/src/testbed/testbed_api_operations.h @@ -37,44 +37,6 @@ struct OperationQueue; -/** - * Enumeration of operation types - */ -enum OperationType - { - /** - * Peer create operation - */ - OP_PEER_CREATE, - - /** - * Peer start operation - */ - OP_PEER_START, - - /** - * Peer stop operation - */ - OP_PEER_STOP, - - /** - * Peer destroy operation - */ - OP_PEER_DESTROY, - - /** - * Get peer information operation - */ - OP_PEER_INFO, - - /** - * Overlay connection operation - */ - OP_OVERLAY_CONNECT, - - }; - - /** * Create an operation queue. * @@ -97,20 +59,32 @@ GNUNET_TESTBED_operation_queue_destroy_ (struct OperationQueue *queue); /** - * Add an operation to a queue. An operation can be in multiple - * queues at once. Once all queues permit the operation to become - * active, the operation will be activated. The actual activation - * will occur in a separate task (thus allowing multiple queue - * insertions to be made without having the first one instantly - * trigger the operation if the first queue has sufficient - * resources). + * Add an operation to a queue. An operation can be in multiple queues at + * once. Once the operation is inserted into all the queues + * GNUNET_TESTBED_operation_begin_wait_() has to be called to actually start + * waiting for the operation to become active. * * @param queue queue to add the operation to * @param operation operation to add to the queue */ void GNUNET_TESTBED_operation_queue_insert_ (struct OperationQueue *queue, - struct GNUNET_TESTBED_Operation *operation); + struct GNUNET_TESTBED_Operation + *operation); + + +/** + * Marks the given operation as waiting on the queues. Once all queues permit + * the operation to become active, the operation will be activated. The actual + * activation will occur in a separate task (thus allowing multiple queue + * insertions to be made without having the first one instantly trigger the + * operation if the first queue has sufficient resources). + * + * @param operation the operation to marks as waiting + */ +void +GNUNET_TESTBED_operation_begin_wait_ (struct GNUNET_TESTBED_Operation + *operation); /** @@ -124,7 +98,8 @@ GNUNET_TESTBED_operation_queue_insert_ (struct OperationQueue *queue, */ void GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, - struct GNUNET_TESTBED_Operation *operation); + struct GNUNET_TESTBED_Operation + *operation); @@ -135,7 +110,7 @@ GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, * * @param cls the closure from GNUNET_TESTBED_operation_create_() */ -typedef void (*OperationStart)(void *cls); +typedef void (*OperationStart) (void *cls); /** @@ -151,7 +126,7 @@ typedef void (*OperationStart)(void *cls); * * @param cls the closure from GNUNET_TESTBED_operation_create_() */ -typedef void (*OperationRelease)(void *cls); +typedef void (*OperationRelease) (void *cls); /** @@ -160,15 +135,11 @@ typedef void (*OperationRelease)(void *cls); * @param cls closure for the callbacks * @param start function to call to start the operation * @param release function to call to close down the operation - * @param type the type of the operation - * @param data operation's relavant data * @return handle to the operation */ struct GNUNET_TESTBED_Operation * -GNUNET_TESTBED_operation_create_ (void *cls, - OperationStart start, - OperationRelease release, - enum OperationType type); +GNUNET_TESTBED_operation_create_ (void *cls, OperationStart start, + OperationRelease release); /**