GNUnet  0.11.x
testing_messenger_barrier.h
Go to the documentation of this file.
1 /*
2  This file is part of GNUnet.
3  Copyright (C) 2021 GNUnet e.V.
4 
5  GNUnet is free software: you can redistribute it and/or modify it
6  under the terms of the GNU Affero General Public License as published
7  by the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  GNUnet is distributed in the hope that it will be useful, but
11  WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Affero General Public License for more details.
14 
15  You should have received a copy of the GNU Affero General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  SPDX-License-Identifier: AGPL3.0-or-later
19  */
26 #ifndef GNUNET_TESTING_MESSENGER_BARRIER_H_
27 #define GNUNET_TESTING_MESSENGER_BARRIER_H_
28 
29 #include "platform.h"
30 #include "gnunet_util_lib.h"
31 
36 
37 
50 typedef void
52  struct GNUNET_BarrierHandle *barrier,
53  int status);
54 
55 
69 GNUNET_init_barrier (unsigned int requirement,
71  void *cb_cls);
72 
73 
79 void
81 
82 
87 
88 
99 typedef void
101  struct GNUNET_BarrierWaitHandle *waiting,
102  int status);
103 
104 
118  void *cb_cls);
119 
120 
127 void
129 
130 
131 #endif /* GNUNET_TESTING_MESSENGER_BARRIER_H_ */
GNUNET_BarrierStatusCallback cb
struct GNUNET_BarrierHandle * GNUNET_init_barrier(unsigned int requirement, GNUNET_BarrierStatusCallback cb, void *cb_cls)
Initialise a pseudo-barrier and call the given callback when the required amount of peers (requiremen...
GNUNET_BarrierWaitStatusCallback cb
void GNUNET_cancel_barrier(struct GNUNET_BarrierHandle *barrier)
Cancel a pseudo-barrier.
void(* GNUNET_BarrierStatusCallback)(void *cls, struct GNUNET_BarrierHandle *barrier, int status)
Functions of this type are to be given as callback argument to GNUNET_init_barrier().
void GNUNET_cancel_wait_barrier(struct GNUNET_BarrierWaitHandle *waiting)
Cancel a pseudo-barrier wait handle.
struct GNUNET_BarrierWaitHandle * GNUNET_wait_barrier(struct GNUNET_BarrierHandle *barrier, GNUNET_BarrierWaitStatusCallback cb, void *cb_cls)
Wait for a pseudo-barrier to be crossed.
uint16_t status
See PRISM_STATUS_*-constants.
void(* GNUNET_BarrierWaitStatusCallback)(void *cls, struct GNUNET_BarrierWaitHandle *waiting, int status)
Functions of this type are to be given as acallback argument to GNUNET_wait_barrier().