0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-30 04:38:52 +02:00

ircd::ios: Start an opaque interface; add name().

This commit is contained in:
Jason Volk 2019-04-10 15:01:11 -07:00
parent 565d6e8381
commit 9f07790b41

View file

@ -50,6 +50,9 @@ namespace ircd::ios
bool available();
asio::io_context &get();
const string_view &name(const descriptor &);
const string_view &name(const handler &);
void dispatch(descriptor &, std::function<void ()>);
void post(descriptor &, std::function<void ()>);
void dispatch(std::function<void ()>);
@ -212,6 +215,19 @@ ircd::ios::asio_handler_deallocate(void *const ptr,
handler::deallocate(h, ptr, size);
}
inline const ircd::string_view &
ircd::ios::name(const handler &handler)
{
assert(handler.descriptor);
return name(*handler.descriptor);
}
inline const ircd::string_view &
ircd::ios::name(const descriptor &descriptor)
{
return descriptor.name;
}
inline void
ircd::ios::assert_main_thread()
{