Compare commits

..

4 Commits

Author SHA1 Message Date
e16305d3dd Merge pull request 'fix/reinit' (#3) from fix/reinit into master
Some checks failed
android / build (x86) (push) Failing after 23m34s
android / build (x86_64) (push) Failing after 21m42s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Failing after 23m53s
android / build (armeabi-v7a) (push) Failing after 14m33s
android / build (arm64-v8a) (push) Failing after 14m45s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Failing after 28m5s
linux-arm-gcc / linux-gcc-arm (Debug) (push) Failing after 24m18s
linux-arm-gcc / linux-gcc-arm (Release) (push) Failing after 21m24s
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Failing after 12m15s
linux-arm-gcc / linux-gcc-armhf (Release) (push) Failing after 14m45s
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Failing after 30m1s
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Failing after 35m12s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 31m51s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 26m45s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Failing after 41m46s
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Failing after 24m42s
linux-x64-clang / linux-clang (Debug) (push) Failing after 21m21s
linux-x64-clang / linux-clang (Release) (push) Successful in 19m21s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 44m8s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 1h0m43s
linux-x86-gcc / linux-gcc (Debug) (push) Successful in 29m36s
linux-x86-gcc / linux-gcc (Release) (push) Failing after 48m51s
Reviewed-on: #3
2025-04-02 13:31:15 +00:00
tqcq
acacfbe188 fix crash on init
Some checks failed
linux-arm-gcc / linux-gcc-arm (Release) (pull_request) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Debug) (pull_request) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Waiting to run
linux-arm-gcc / linux-gcc-armhf (Release) (pull_request) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Debug) (pull_request) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Waiting to run
linux-mips-gcc / linux-gcc-mipsel (Release) (pull_request) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Debug) (pull_request) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Waiting to run
linux-mips64-gcc / linux-gcc-mips64el (Release) (pull_request) Waiting to run
linux-x64-clang / linux-clang (Debug) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (pull_request) Waiting to run
linux-x64-clang / linux-clang (Release) (push) Waiting to run
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (pull_request) Waiting to run
android / build (arm64-v8a) (pull_request) Failing after 10m7s
android / build (x86_64) (push) Failing after 10m21s
android / build (x86) (push) Failing after 10m29s
android / build (armeabi-v7a) (push) Failing after 10m39s
android / build (arm64-v8a) (push) Failing after 10m54s
linux-x64-clang / linux-clang (Release) (pull_request) Failing after 11m47s
linux-x64-clang / linux-clang (Debug) (pull_request) Failing after 11m55s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 12m6s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 12m14s
linux-x86-gcc / linux-gcc (Debug) (push) Failing after 34m32s
linux-x86-gcc / linux-gcc (Release) (push) Successful in 39m10s
linux-x64-gcc / linux-gcc (Debug) (pull_request) Failing after 13m6s
linux-x64-gcc / linux-gcc (Release) (pull_request) Successful in 34m11s
2025-04-02 19:33:43 +08:00
86f52567b7 Merge pull request 'fix reinit' (#4) from fix/reinit into develop
All checks were successful
android / build (arm64-v8a) (push) Successful in 5m51s
android / build (armeabi-v7a) (push) Successful in 5m49s
android / build (x86) (push) Successful in 4m44s
android / build (x86_64) (push) Successful in 5m14s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (push) Successful in 15m34s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (push) Successful in 15m52s
linux-arm-gcc / linux-gcc-arm (Release) (push) Successful in 14m16s
linux-arm-gcc / linux-gcc-arm (Debug) (push) Successful in 15m20s
linux-arm-gcc / linux-gcc-armhf (Release) (push) Successful in 13m27s
linux-arm-gcc / linux-gcc-armhf (Debug) (push) Successful in 15m44s
linux-mips-gcc / linux-gcc-mipsel (Release) (push) Successful in 15m21s
linux-mips-gcc / linux-gcc-mipsel (Debug) (push) Successful in 15m44s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Successful in 15m23s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Successful in 15m6s
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Successful in 15m52s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Successful in 17m13s
linux-x64-clang / linux-clang (Debug) (push) Successful in 10m7s
linux-x64-clang / linux-clang (Release) (push) Successful in 10m36s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 13m9s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 13m25s
linux-x86-gcc / linux-gcc (Release) (push) Successful in 14m7s
linux-x86-gcc / linux-gcc (Debug) (push) Successful in 14m17s
Reviewed-on: #4
2025-03-06 09:21:03 +00:00
tqcq
471c2c1756 fix reinit
Some checks failed
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (push) Successful in 15m39s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (push) Successful in 16m28s
linux-x64-clang / linux-clang (Debug) (push) Successful in 10m24s
linux-x64-clang / linux-clang (Release) (push) Successful in 10m30s
linux-x64-gcc / linux-gcc (Debug) (push) Successful in 13m3s
linux-x64-gcc / linux-gcc (Release) (push) Successful in 13m24s
linux-x86-gcc / linux-gcc (Debug) (push) Successful in 14m47s
linux-x86-gcc / linux-gcc (Release) (push) Successful in 14m40s
android / build (arm64-v8a) (pull_request) Successful in 5m52s
android / build (armeabi-v7a) (pull_request) Successful in 5m49s
android / build (x86_64) (pull_request) Failing after 11m6s
android / build (x86) (pull_request) Failing after 11m11s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Debug) (pull_request) Successful in 15m43s
linux-arm-gcc / linux-gcc-arm (Release) (pull_request) Successful in 14m38s
linux-arm-gcc / linux-gcc-arm (Debug) (pull_request) Successful in 16m19s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (Release) (pull_request) Successful in 18m32s
linux-arm-gcc / linux-gcc-armhf (Release) (pull_request) Successful in 13m17s
linux-arm-gcc / linux-gcc-armhf (Debug) (pull_request) Successful in 15m37s
linux-mips-gcc / linux-gcc-mipsel (Debug) (pull_request) Successful in 15m22s
linux-mips-gcc / linux-gcc-mipsel (Release) (pull_request) Successful in 15m56s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (pull_request) Successful in 16m11s
linux-mips64-gcc / linux-gcc-mips64el (Release) (pull_request) Successful in 15m46s
linux-riscv64-gcc / linux-gcc-riscv64 (Debug) (pull_request) Successful in 16m24s
linux-riscv64-gcc / linux-gcc-riscv64 (Release) (pull_request) Successful in 15m37s
linux-x64-clang / linux-clang (Debug) (pull_request) Successful in 9m34s
linux-x64-clang / linux-clang (Release) (pull_request) Successful in 10m25s
linux-x64-gcc / linux-gcc (Release) (pull_request) Successful in 13m14s
linux-x64-gcc / linux-gcc (Debug) (pull_request) Successful in 14m21s
linux-x86-gcc / linux-gcc (Debug) (pull_request) Successful in 14m55s
linux-x86-gcc / linux-gcc (Release) (pull_request) Successful in 15m2s
2025-03-06 17:20:06 +08:00
4 changed files with 20 additions and 13 deletions

1
.gitignore vendored
View File

@ -4,4 +4,3 @@ build/
compile_commands.json compile_commands.json
.gdb_history .gdb_history
.cmake.conf .cmake.conf
third_party/

View File

@ -223,8 +223,26 @@ if((CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64") OR (CMAKE_SYSTEM_PROCESSOR MATCHES
endif() endif()
endif() endif()
# set(LIB_NAMES tile)
#
# if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU) OR
# ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") OR ("${CMAKE_SYSTEM_NAME}"
# STREQUAL "GNU") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") OR
# ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") OR ("${CMAKE_SYSTEM_NAME}"
# STREQUAL "DragonFly") OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME:
# It should be "GNU ld # for elf" set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES}
# -Wl,--no-whole-archive) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
# set(LIB_NAMES -Wl,-all_load ${LIB_NAMES}) endif()
add_library(tile::tile ALIAS tile) add_library(tile::tile ALIAS tile)
# add_library(tile SHARED $<TARGET_OBJECTS:tile>) target_include_directories(
# tile PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmt/include"
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/glog"
# "${CMAKE_CURRENT_SOURCE_DIR}/third_party/glog/src"
# "${CMAKE_CURRENT_SOURCE_DIR}" RPIVATE
# "${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include")
# target_link_libraries( tile PRIVATE ${WHOLE_ARCHIVE_PREFIX} gflags::gflags
# glog::glog libcurl fmt::fmt ${NO_WHOLE_ARCHIVE_PREFIX})
if(TILE_BUILD_TESTS) if(TILE_BUILD_TESTS)
enable_testing() enable_testing()

View File

@ -5,7 +5,4 @@
- [ ] 支持UDP - [ ] 支持UDP
- [ ] 支持TCP - [ ] 支持TCP
## 同步容器
- [ ] queue

View File

@ -32,7 +32,6 @@ namespace tile {
namespace { namespace {
std::atomic<bool> g_quit_siganl{false}; std::atomic<bool> g_quit_siganl{false};
std::atomic<bool> g_tile_running{false};
void void
QuitSignalHandler(int sig) QuitSignalHandler(int sig)
@ -59,11 +58,6 @@ InstallQuitSignalHandler()
int int
Start(int argc, char **argv, std::function<int(int, char **)> cb, bool single_thread, bool enable_crash_catch) Start(int argc, char **argv, std::function<int(int, char **)> cb, bool single_thread, bool enable_crash_catch)
{ {
{
bool expected = false;
TILE_CHECK(g_tile_running.compare_exchange_strong(expected, true), "tile already running.");
}
if (enable_crash_catch) { if (enable_crash_catch) {
// TODO: Add InstallFailureSignalHandler // TODO: Add InstallFailureSignalHandler
// google::InstallFailureSignalHandler(); // google::InstallFailureSignalHandler();
@ -140,14 +134,13 @@ TerminateBasicRuntime()
std::mutex init_lock; std::mutex init_lock;
std::condition_variable init_cv; std::condition_variable init_cv;
std::thread *lib_thread; std::thread *lib_thread;
const char *my_argv[1] = {"unknown"};
void void
Init(int argc, char **argv, std::function<int(int, char **)> cb) Init(int argc, char **argv, std::function<int(int, char **)> cb)
{ {
std::unique_lock<std::mutex> _(init_lock); std::unique_lock<std::mutex> _(init_lock);
TILE_CHECK(g_tile_running.load() == false, "tile already running."); assert(!lib_thread && "ReInitialize!!!");
assert(lib_thread && "ReInitialize!!!");
const char *my_argv[1] = {"unknown"};
if (!argv) { if (!argv) {
argc = 1; argc = 1;