MCPcopy Create free account
hub / github.com/ElementsProject/lightning / plugins_exclusive_loop

Function plugins_exclusive_loop

lightningd/plugin.c:2081–2106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2079}
2080
2081void *plugins_exclusive_loop(struct plugin **plugins)
2082{
2083 void *ret;
2084 size_t i;
2085 bool last = false;
2086 assert(tal_count(plugins) != 0);
2087
2088 for (i = 0; i < tal_count(plugins); ++i) {
2089 io_conn_out_exclusive(plugins[i]->stdin_conn, true);
2090 io_conn_exclusive(plugins[i]->stdout_conn, true);
2091 }
2092
2093 /* We don't service timers here, either! */
2094 ret = io_loop(NULL, NULL);
2095 log_debug(plugins[0]->plugins->ld->log, "io_loop: %s", __func__);
2096
2097 for (i = 0; i < tal_count(plugins); ++i) {
2098 io_conn_out_exclusive(plugins[i]->stdin_conn, false);
2099 last = io_conn_exclusive(plugins[i]->stdout_conn, false);
2100 }
2101 if (last)
2102 fatal("Still io_exclusive after removing plugin %s?",
2103 plugins[tal_count(plugins) - 1]->cmd);
2104
2105 return ret;
2106}
2107
2108struct log *plugin_get_log(struct plugin *plugin)
2109{

Callers 1

plugin_hook_db_syncFunction · 0.85

Calls 4

io_conn_out_exclusiveFunction · 0.85
io_conn_exclusiveFunction · 0.85
io_loopFunction · 0.85
fatalFunction · 0.70

Tested by

no test coverage detected