Add thread safety documentation
This commit is contained in:
@@ -5,6 +5,16 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
|
||||
std::unique_ptr<Connection>
|
||||
Connection::createForServer(struct sockaddr_storage addr, int fd, int64_t id,
|
||||
ConnectionHandler *handler,
|
||||
std::weak_ptr<Server> server) {
|
||||
// Use unique_ptr constructor with private access (friend function)
|
||||
// We can't use make_unique here because constructor is private
|
||||
return std::unique_ptr<Connection>(
|
||||
new Connection(addr, fd, id, handler, server));
|
||||
}
|
||||
|
||||
Connection::Connection(struct sockaddr_storage addr, int fd, int64_t id,
|
||||
ConnectionHandler *handler, std::weak_ptr<Server> server)
|
||||
: fd_(fd), id_(id), addr_(addr), arena_(), handler_(handler),
|
||||
|
||||
Reference in New Issue
Block a user