feat remove marl
Some checks failed
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 46s
linux-arm-gcc / linux-gcc-armhf (push) Failing after 42s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 47s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 1m2s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 37s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 52s

This commit is contained in:
Your Name 2024-12-04 15:38:52 +08:00
parent be0d0922f9
commit 1f8a250845
9 changed files with 40 additions and 33 deletions

View File

@ -39,9 +39,9 @@ add_subdirectory(3party/minilua EXCLUDE_FROM_ALL)
if(SLED_WITH_PROTOBUF) if(SLED_WITH_PROTOBUF)
add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL) add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL)
endif() endif()
if(NOT TARGET marl) # if(NOT TARGET marl)
add_subdirectory(3party/marl EXCLUDE_FROM_ALL) # add_subdirectory(3party/marl EXCLUDE_FROM_ALL)
endif() # endif()
if(NOT TARGET rpc_core) if(NOT TARGET rpc_core)
add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL) add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL)
@ -106,7 +106,7 @@ target_sources(
target_link_libraries( target_link_libraries(
sled sled
PUBLIC rpc_core fmt marl minilua asio PUBLIC rpc_core fmt minilua asio
# protobuf::libprotoc # protobuf::libprotoc
PRIVATE dl) PRIVATE dl)
# if(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_link_libraries(sled PUBLIC # if(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_link_libraries(sled PUBLIC
@ -191,7 +191,7 @@ if(SLED_BUILD_TESTS)
src/sled/status_or_test.cc src/sled/status_or_test.cc
src/sled/strings/utils_test.cc src/sled/strings/utils_test.cc
src/sled/strings/base64_test.cc src/sled/strings/base64_test.cc
src/sled/system/fiber/fiber_test.cc # src/sled/system/fiber/fiber_test.cc
src/sled/system/thread_pool_test.cc src/sled/system/thread_pool_test.cc
# src/sled/rx_test.cc # src/sled/rx_test.cc
src/sled/uri_test.cc) src/sled/uri_test.cc)

View File

@ -5,6 +5,7 @@
#include "sled/sigslot.h" #include "sled/sigslot.h"
#include "sled/synchronization/mutex.h" #include "sled/synchronization/mutex.h"
#include <typeindex> #include <typeindex>
#include <unordered_map>
namespace sled { namespace sled {
@ -181,7 +182,7 @@ public:
private: private:
sled::Mutex mutex_; sled::Mutex mutex_;
std::unordered_map<std::type_index, std::function<void(EventBus *)>> cleanup_handlers_ GUARDED_BY(mutex_); std::unordered_map<std::type_index, std::function<void(EventBus *)>> cleanup_handlers_;//GUARDED_BY(mutex_);
}; };
}// namespace sled }// namespace sled
#endif// SLED_EVENT_BUS_EVENT_BUS_H #endif// SLED_EVENT_BUS_EVENT_BUS_H

View File

@ -59,9 +59,9 @@ private:
bool WaitSelect(int64_t cusWait, bool process_io); bool WaitSelect(int64_t cusWait, bool process_io);
uint64_t next_dispatcher_key_ = 0; uint64_t next_dispatcher_key_ = 0;
std::unordered_map<uint64_t, Dispatcher *> dispatcher_by_key_ GUARDED_BY(lock_); std::unordered_map<uint64_t, Dispatcher *> dispatcher_by_key_;//GUARDED_BY(lock_);
std::unordered_map<Dispatcher *, uint64_t> key_by_dispatcher_ GUARDED_BY(lock_); std::unordered_map<Dispatcher *, uint64_t> key_by_dispatcher_;//GUARDED_BY(lock_);
std::vector<uint64_t> current_dispatcher_keys_ GUARDED_BY(lock_); std::vector<uint64_t> current_dispatcher_keys_; //GUARDED_BY(lock_);
Signaler *signal_wakeup_; Signaler *signal_wakeup_;
// Mutex lock_; // Mutex lock_;
RecursiveMutex lock_; RecursiveMutex lock_;
@ -124,7 +124,7 @@ protected:
bool udp_; bool udp_;
int family_ = 0; int family_ = 0;
mutable Mutex mutex_; mutable Mutex mutex_;
int error_ GUARDED_BY(mutex_); int error_;//GUARDED_BY(mutex_);
ConnState state_; ConnState state_;
AsyncResolver *resolver_; AsyncResolver *resolver_;

View File

@ -65,8 +65,8 @@
#include "sled/synchronization/sequence_checker.h" #include "sled/synchronization/sequence_checker.h"
#include "sled/synchronization/thread_local.h" #include "sled/synchronization/thread_local.h"
// system // system
#include "sled/system/fiber/scheduler.h" // #include "sled/system/fiber/scheduler.h"
#include "sled/system/fiber/wait_group.h" // #include "sled/system/fiber/wait_group.h"
#include "sled/system/location.h" #include "sled/system/location.h"
#include "sled/system/thread.h" #include "sled/system/thread.h"
#include "sled/system/thread_pool.h" #include "sled/system/thread_pool.h"

View File

@ -11,8 +11,11 @@
#include "sled/lang/attributes.h" #include "sled/lang/attributes.h"
#include "sled/units/time_delta.h" #include "sled/units/time_delta.h"
#include <chrono> #include <chrono>
#include <marl/conditionvariable.h> // #include <marl/conditionvariable.h>
#include <marl/mutex.h> // #include <marl/mutex.h>
#include <atomic>
#include <condition_variable>
#include <mutex>
// #include <condition_variable> // #include <condition_variable>
// #include <mutex> // #include <mutex>
#include <type_traits> #include <type_traits>
@ -50,7 +53,8 @@ public:
inline void Unlock() SLED_UNLOCK_FUNCTION(impl_) { impl_.unlock(); } inline void Unlock() SLED_UNLOCK_FUNCTION(impl_) { impl_.unlock(); }
private: private:
marl::mutex impl_; // marl::mutex impl_;
std::mutex impl_;
friend class ConditionVariable; friend class ConditionVariable;
friend class MutexLock; friend class MutexLock;
}; };
@ -110,7 +114,8 @@ public:
private: private:
friend class ConditionVariable; friend class ConditionVariable;
marl::lock lock_; // marl::lock lock_;
std::unique_lock<std::mutex> lock_;
}; };
class ConditionVariable final { class ConditionVariable final {
@ -143,10 +148,11 @@ public:
} }
private: private:
marl::ConditionVariable cv_; std::condition_variable cv_;
// marl::ConditionVariable cv_;
}; };
class SCOPED_CAPABILITY SharedMutex final { class SharedMutex final {
public: public:
enum class Mode { enum class Mode {
kReaderPriority, kReaderPriority,

View File

@ -25,7 +25,7 @@ public:
} }
private: private:
bool happended_ GUARDED_BY(mutex_) = false; bool happended_;//GUARDED_BY(mutex_) = false;
Mutex mutex_; Mutex mutex_;
}; };

View File

@ -30,9 +30,9 @@ public:
private: private:
mutable Mutex mutex_; mutable Mutex mutex_;
mutable bool attached_ GUARDED_BY(mutex_); mutable bool attached_; //GUARDED_BY(mutex_);
mutable pthread_t valid_thread_ GUARDED_BY(mutex_); mutable pthread_t valid_thread_; //GUARDED_BY(mutex_);
mutable const TaskQueueBase *valid_queue_ GUARDED_BY(mutex_); mutable const TaskQueueBase *valid_queue_;//GUARDED_BY(mutex_);
}; };
class SequenceCheckerDoNothing { class SequenceCheckerDoNothing {

View File

@ -135,9 +135,9 @@ private:
void ClearCurrentTaskQueue(); void ClearCurrentTaskQueue();
mutable Mutex mutex_; mutable Mutex mutex_;
std::queue<std::function<void()>> messages_ GUARDED_BY(mutex_); std::queue<std::function<void()>> messages_; //GUARDED_BY(mutex_);
std::priority_queue<DelayedMessage> delayed_messages_ GUARDED_BY(mutex_); std::priority_queue<DelayedMessage> delayed_messages_;//GUARDED_BY(mutex_);
uint32_t delayed_next_num_ GUARDED_BY(mutex_); uint32_t delayed_next_num_; //GUARDED_BY(mutex_);
bool fInitialized_; bool fInitialized_;
bool fDestroyed_; bool fDestroyed_;
std::atomic<int> stop_; std::atomic<int> stop_;

View File

@ -2,7 +2,7 @@
#ifndef SLED_SYSTEM_THREAD_POOL_H #ifndef SLED_SYSTEM_THREAD_POOL_H
#define SLED_SYSTEM_THREAD_POOL_H #define SLED_SYSTEM_THREAD_POOL_H
#include "sled/synchronization/mutex.h" #include "sled/synchronization/mutex.h"
#include "sled/system/fiber/scheduler.h" // #include "sled/system/fiber/scheduler.h"
#include "sled/system/thread.h" #include "sled/system/thread.h"
#include <functional> #include <functional>
#include <future> #include <future>