자잘한 수정, 이제 다른 소켓으로 쓰기 요청 할 수 있을 듯

This commit is contained in:
2025-05-03 13:59:04 +09:00
parent 181d30ff28
commit f765c163bf
12 changed files with 512 additions and 310 deletions

View File

@@ -12,6 +12,19 @@ struct Snowflake {
};
std::uint64_t snowflake;
};
bool operator==(const Snowflake& other) const {
return snowflake == other.snowflake;
}
};
}
namespace std {
template <>
struct hash<Chattr::Snowflake> {
std::size_t operator()(const Chattr::Snowflake& k) const {
return std::hash<uint64_t>{}(k.snowflake);
}
};
}

View File

@@ -64,9 +64,9 @@ public:
handle_ = (HANDLE)_beginthreadex(nullptr, 0, thread_func, funcPtr, 0, nullptr);
#elif __linux__
int rc = pthread_create(&handle_, NULL, thread_func, funcPtr);
#endif
if (handle_ <= 0 || rc != 0)
log::critical("pthread_create()");
#endif
}
~Thread();