Command to signal barrier was reached. More...
#include "platform.h"
#include "gnunet_testing_lib.h"
#include "testing_cmds.h"
#include "gnunet_testing_plugin.h"
#include "gnunet_testing_barrier.h"
#include "gnunet_testing_netjail_lib.h"
#include "testing.h"
Go to the source code of this file.
Data Structures | |
struct | BarrierReachedState |
Struct with information for callbacks. More... | |
Macros | |
#define | LOG(kind, ...) GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut. More... | |
Functions | |
static void | barrier_reached_run (void *cls, struct GNUNET_TESTING_Interpreter *is) |
Run the command. More... | |
static void | barrier_reached_cleanup (void *cls) |
Cleanup the state from a "barrier reached" CMD, and possibly cancel a pending operation thereof. More... | |
static enum GNUNET_GenericReturnValue | barrier_reached_traits (void *cls, const void **ret, const char *trait, unsigned int index) |
Offer internal data from a "batch" CMD, to other commands. More... | |
struct GNUNET_TESTING_Command | GNUNET_TESTING_cmd_barrier_reached (const char *label, const char *barrier_label, unsigned int asynchronous_finish, unsigned int node_number, unsigned int running_on_master, GNUNET_TESTING_cmd_helper_write_cb write_message) |
Create command. More... | |
Command to signal barrier was reached.
Definition in file testing_api_cmd_barrier_reached.c.
#define LOG | ( | kind, | |
... | |||
) | GNUNET_log (kind, __VA_ARGS__) |
Generic logging shortcut.
Definition at line 37 of file testing_api_cmd_barrier_reached.c.
|
static |
Run the command.
cls | closure. |
is | the interpreter state. |
Definition at line 90 of file testing_api_cmd_barrier_reached.c.
References GNUNET_TESTING_Command::asynchronous_finish, BarrierReachedState::asynchronous_finish, BarrierReachedState::barrier_name, GNUNET_TESTING_Barrier::cmds_head, GNUNET_TESTING_Barrier::cmds_tail, CommandListEntry::command, GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_ERROR_TYPE_DEBUG, GNUNET_malloc, GNUNET_MESSAGE_TYPE_CMDS_HELPER_BARRIER_REACHED, GNUNET_new, GNUNET_NO, GNUNET_TESTING_barrier_crossable(), GNUNET_TESTING_interpreter_get_current_command(), GNUNET_YES, is, LOG, msg, GNUNET_TESTING_Barrier::name, BarrierReachedState::node_number, GNUNET_TESTING_Barrier::reached, BarrierReachedState::running_on_master, GNUNET_MessageHeader::size, TST_interpreter_add_barrier(), TST_interpreter_finish_attached_cmds(), TST_interpreter_get_barrier(), GNUNET_MessageHeader::type, and BarrierReachedState::write_message.
|
static |
Cleanup the state from a "barrier reached" CMD, and possibly cancel a pending operation thereof.
cls | closure. |
Definition at line 157 of file testing_api_cmd_barrier_reached.c.
References GNUNET_free.
|
static |
Offer internal data from a "batch" CMD, to other commands.
cls | closure. | |
[out] | ret | result. |
trait | name of the trait. | |
index | index number of the object to offer. |
Definition at line 157 of file testing_api_cmd_barrier_reached.c.
struct GNUNET_TESTING_Command GNUNET_TESTING_cmd_barrier_reached | ( | const char * | label, |
const char * | barrier_label, | ||
unsigned int | asynchronous_finish, | ||
unsigned int | node_number, | ||
unsigned int | running_on_master, | ||
GNUNET_TESTING_cmd_helper_write_cb | write_message | ||
) |
Create command.
If this command is executed the the process is signaling the master process that it reached a barrier.
label | name for command. |
barrier_label | The name of the barrier we wait for (if finishing asynchronous) and which will be reached. |
asynchronous_finish | If GNUNET_YES this command will not block. |
node_number | The global numer of the node the cmd runs on. |
running_on_master | Is this cmd running on the master loop. |
write_message | Callback to write messages to the master loop. |
Definition at line 157 of file testing_api_cmd_barrier_reached.c.