0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-19 00:10:59 +01:00

ircd::net: Assert proper socket object semantics.

This commit is contained in:
Jason Volk 2018-04-12 12:52:14 -07:00
parent 345870feb9
commit 8bf0b4d093
2 changed files with 3 additions and 0 deletions

View file

@ -108,6 +108,8 @@ struct ircd::net::socket
// Socket cannot be copied or moved; must be constructed as shared ptr
socket(socket &&) = delete;
socket(const socket &) = delete;
socket &operator=(socket &&) = delete;
socket &operator=(const socket &) = delete;
~socket() noexcept;
};

View file

@ -1330,6 +1330,7 @@ ircd::net::socket::socket(asio::ssl::context &ssl,
ircd::net::socket::~socket()
noexcept try
{
assert(instances > 0);
if(unlikely(--instances == 0))
net::dock.notify_all();