diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-03 09:12:57 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-03 09:12:57 +0000 |
commit | d4922969a54f83b3c2d7503a9bda2708700869c8 (patch) | |
tree | 6464df644674dec7600a3f82988e4035245e4215 /src/include/gnunet_testbed_service.h | |
parent | 9b8e106ae9b8187de0092046d2ceaaf4dcd4852b (diff) | |
download | gnunet-d4922969a54f83b3c2d7503a9bda2708700869c8.tar.gz gnunet-d4922969a54f83b3c2d7503a9bda2708700869c8.zip |
- barrier wait API
Diffstat (limited to 'src/include/gnunet_testbed_service.h')
-rw-r--r-- | src/include/gnunet_testbed_service.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 1810c9f25..a99faf007 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -1551,6 +1551,53 @@ void | |||
1551 | GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier); | 1551 | GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier); |
1552 | 1552 | ||
1553 | 1553 | ||
1554 | /** | ||
1555 | * Opaque handle for barrier wait | ||
1556 | */ | ||
1557 | struct GNUNET_TESTBED_BarrierWaitHandle; | ||
1558 | |||
1559 | |||
1560 | /** | ||
1561 | * Functions of this type are to be given as acallback argumetn to | ||
1562 | * GNUNET_TESTBED_barrier_wait(). The callback will be called when the barrier | ||
1563 | * corresponding given in GNUNET_TESTBED_barrier_wait() is crossed or cancelled. | ||
1564 | * | ||
1565 | * @param cls closure pointer given to GNUNET_TESTBED_barrier_wait() | ||
1566 | * @param name the barrier name | ||
1567 | * @param status GNUNET_SYSERR in case of error while waiting for the barrier; | ||
1568 | * GNUNET_OK if the barrier is crossed | ||
1569 | */ | ||
1570 | typedef void (*GNUNET_TESTBED_barrier_wait_cb) (void *cls, | ||
1571 | const char *name, | ||
1572 | int estatus); | ||
1573 | |||
1574 | |||
1575 | /** | ||
1576 | * Wait for a barrier to be crossed. This function should be called by the | ||
1577 | * peers which have been started by the testbed. If the peer is not started by | ||
1578 | * testbed this function may return error | ||
1579 | * | ||
1580 | * @param name the name of the barrier | ||
1581 | * @param cb the barrier wait callback | ||
1582 | * @param cls the closure for the above callback | ||
1583 | * @return barrier wait handle which can be used to cancel the waiting at | ||
1584 | * anytime before the callback is called. NULL upon error. | ||
1585 | */ | ||
1586 | struct GNUNET_TESTBED_BarrierWaitHandle * | ||
1587 | GNUNET_TESTBED_barrier_wait (const char *name, | ||
1588 | GNUNET_TESTBED_barrier_wait_cb cb, | ||
1589 | void *cls); | ||
1590 | |||
1591 | |||
1592 | /** | ||
1593 | * Cancel a barrier wait handle | ||
1594 | * | ||
1595 | * @param h the barrier wait handle | ||
1596 | */ | ||
1597 | void | ||
1598 | GNUNET_TESTBED_barrier_wait_cancel (struct GNUNET_TESTBED_BarrierWaitHandle *h); | ||
1599 | |||
1600 | |||
1554 | #if 0 /* keep Emacsens' auto-indent happy */ | 1601 | #if 0 /* keep Emacsens' auto-indent happy */ |
1555 | { | 1602 | { |
1556 | #endif | 1603 | #endif |