mirror of
https://github.com/matrix-construct/construct
synced 2024-11-17 23:40:57 +01:00
ircd::ios: Start an opaque interface; add name().
This commit is contained in:
parent
565d6e8381
commit
9f07790b41
1 changed files with 16 additions and 0 deletions
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue