X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ftestbed%2Ftestbed_api_operations.h;h=e78ed0fcc1324a11043acbe25f47ebf24d59f204;hb=f4d040c0f0dd2fef3d73b1f4532c76219f760f75;hp=5edca152de9ca9881b6e3a288990a83ad9211f76;hpb=8b9b2ab39943070706515485cff6e23cbb564003;p=oweals%2Fgnunet.git diff --git a/src/testbed/testbed_api_operations.h b/src/testbed/testbed_api_operations.h index 5edca152d..e78ed0fcc 100644 --- a/src/testbed/testbed_api_operations.h +++ b/src/testbed/testbed_api_operations.h @@ -59,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); /** @@ -86,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); @@ -94,8 +107,10 @@ GNUNET_TESTBED_operation_queue_remove_ (struct OperationQueue *queue, * Function to call to start an operation once all * queues the operation is part of declare that the * operation can be activated. + * + * @param cls the closure from GNUNET_TESTBED_operation_create_() */ -typedef void (*OperationStart)(void *cls); +typedef void (*OperationStart) (void *cls); /** @@ -107,9 +122,11 @@ typedef void (*OperationStart)(void *cls); * a callback to the 'OperationStart' preceeds the call to * 'OperationRelease'. Implementations of this function are expected * to clean up whatever state is in 'cls' and release all resources - * associated with the operation. + * associated with the operation. + * + * @param cls the closure from GNUNET_TESTBED_operation_create_() */ -typedef void (*OperationRelease)(void *cls); +typedef void (*OperationRelease) (void *cls); /** @@ -118,14 +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 ... FIXME * @return handle to the operation */ struct GNUNET_TESTBED_Operation * -GNUNET_TESTBED_operation_create_ (void *cls, - OperationStart start, - OperationRelease release, - ...); +GNUNET_TESTBED_operation_create_ (void *cls, OperationStart start, + OperationRelease release); /** @@ -135,7 +149,7 @@ GNUNET_TESTBED_operation_create_ (void *cls, * @param operation operation that finished */ void -operation_release_ (struct GNUNET_TESTBED_Operation *operation); +GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *operation); #endif