mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 07:23:53 +01:00
ircd: Remove ircd::strand related.
This commit is contained in:
parent
da5d767431
commit
e2edd13a33
3 changed files with 2 additions and 39 deletions
|
@ -30,19 +30,6 @@
|
|||
#include <boost/asio/spawn.hpp>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
|
||||
struct ircd::strand
|
||||
:asio::io_service::strand
|
||||
{
|
||||
using handler = std::function<void ()>;
|
||||
|
||||
operator const asio::io_service &() const;
|
||||
operator asio::io_service &();
|
||||
|
||||
strand(asio::io_service &ios)
|
||||
:asio::io_service::strand{ios}
|
||||
{}
|
||||
};
|
||||
|
||||
///
|
||||
/// The following IRCd headers are not included in the main stdinc.h list of
|
||||
/// includes because they require boost directly or symbols which we cannot
|
||||
|
@ -52,16 +39,3 @@ struct ircd::strand
|
|||
|
||||
#include <ircd/ctx/continuation.h>
|
||||
#include <ircd/net/asio.h>
|
||||
|
||||
inline ircd::strand::operator
|
||||
asio::io_service &()
|
||||
{
|
||||
return get_io_service();
|
||||
}
|
||||
|
||||
inline ircd::strand::operator
|
||||
const asio::io_service &()
|
||||
const
|
||||
{
|
||||
return const_cast<strand *>(this)->get_io_service();
|
||||
}
|
||||
|
|
|
@ -35,9 +35,6 @@ namespace ircd
|
|||
/// The user's io_service
|
||||
extern asio::io_context *ios;
|
||||
|
||||
/// IRCd's strand of the io_service
|
||||
struct strand extern *strand;
|
||||
|
||||
bool is_main_thread();
|
||||
void assert_main_thread();
|
||||
|
||||
|
|
12
ircd/ircd.cc
12
ircd/ircd.cc
|
@ -8,9 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/asio.h>
|
||||
#include <ircd/m/m.h>
|
||||
|
||||
namespace ircd
|
||||
{
|
||||
enum runlevel _runlevel {runlevel::HALT}; // Current libircd runlevel
|
||||
|
@ -23,7 +20,6 @@ namespace ircd
|
|||
bool nojs; // no ircd::js system init.
|
||||
|
||||
boost::asio::io_context *ios; // user's io service
|
||||
struct strand *strand; // libircd event serializer
|
||||
ctx::ctx *main_context; // Main program loop
|
||||
|
||||
void set_runlevel(const enum runlevel &);
|
||||
|
@ -76,10 +72,8 @@ try
|
|||
// ios.run() is really running.
|
||||
ircd::thread_id = std::this_thread::get_id();
|
||||
|
||||
// Global ircd:: reference to the user's io_context and setup our main
|
||||
// strand on that service.
|
||||
// Global ircd:: reference to the user's io_context
|
||||
ircd::ios = &ios;
|
||||
ircd::strand = new struct strand(ios);
|
||||
|
||||
// The log is available. but it is console-only until conf opens files.
|
||||
log::init();
|
||||
|
@ -122,8 +116,6 @@ try
|
|||
}
|
||||
catch(const std::exception &e)
|
||||
{
|
||||
delete strand;
|
||||
strand = nullptr;
|
||||
throw;
|
||||
}
|
||||
|
||||
|
@ -309,7 +301,7 @@ try
|
|||
// CONTINUATION ON THIS STACK by the user.
|
||||
if(!ircd::runlevel_changed::list.empty())
|
||||
{
|
||||
ios->post([new_runlevel]
|
||||
ircd::post([new_runlevel]
|
||||
{
|
||||
if(new_runlevel == runlevel::HALT)
|
||||
log::notice
|
||||
|
|
Loading…
Reference in a new issue