Loading CMakeLists.txt +5 −5 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ add_subdirectory(3party/minilua EXCLUDE_FROM_ALL) if(SLED_WITH_PROTOBUF) add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL) endif() if(NOT TARGET marl) add_subdirectory(3party/marl EXCLUDE_FROM_ALL) endif() # if(NOT TARGET marl) # add_subdirectory(3party/marl EXCLUDE_FROM_ALL) # endif() if(NOT TARGET rpc_core) add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL) Loading Loading @@ -106,7 +106,7 @@ target_sources( target_link_libraries( sled PUBLIC rpc_core fmt marl minilua asio PUBLIC rpc_core fmt minilua asio # protobuf::libprotoc PRIVATE dl) # if(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_link_libraries(sled PUBLIC Loading Loading @@ -191,7 +191,7 @@ if(SLED_BUILD_TESTS) src/sled/status_or_test.cc src/sled/strings/utils_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/rx_test.cc src/sled/uri_test.cc) Loading src/sled/event_bus/event_bus.h +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ #include "sled/sigslot.h" #include "sled/synchronization/mutex.h" #include <typeindex> #include <unordered_map> namespace sled { Loading Loading @@ -181,7 +182,7 @@ public: private: 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 #endif// SLED_EVENT_BUS_EVENT_BUS_H src/sled/network/physical_socket_server.h +11 −11 Original line number Diff line number Diff line Loading @@ -59,9 +59,9 @@ private: bool WaitSelect(int64_t cusWait, bool process_io); uint64_t next_dispatcher_key_ = 0; 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::vector<uint64_t> current_dispatcher_keys_ 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::vector<uint64_t> current_dispatcher_keys_; //GUARDED_BY(lock_); Signaler *signal_wakeup_; // Mutex lock_; RecursiveMutex lock_; Loading Loading @@ -124,7 +124,7 @@ protected: bool udp_; int family_ = 0; mutable Mutex mutex_; int error_ GUARDED_BY(mutex_); int error_;//GUARDED_BY(mutex_); ConnState state_; AsyncResolver *resolver_; Loading src/sled/sled.h +2 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ #include "sled/synchronization/sequence_checker.h" #include "sled/synchronization/thread_local.h" // system #include "sled/system/fiber/scheduler.h" #include "sled/system/fiber/wait_group.h" // #include "sled/system/fiber/scheduler.h" // #include "sled/system/fiber/wait_group.h" #include "sled/system/location.h" #include "sled/system/thread.h" #include "sled/system/thread_pool.h" Loading src/sled/synchronization/mutex.h +12 −6 Original line number Diff line number Diff line Loading @@ -11,8 +11,11 @@ #include "sled/lang/attributes.h" #include "sled/units/time_delta.h" #include <chrono> #include <marl/conditionvariable.h> #include <marl/mutex.h> // #include <marl/conditionvariable.h> // #include <marl/mutex.h> #include <atomic> #include <condition_variable> #include <mutex> // #include <condition_variable> // #include <mutex> #include <type_traits> Loading Loading @@ -50,7 +53,8 @@ public: inline void Unlock() SLED_UNLOCK_FUNCTION(impl_) { impl_.unlock(); } private: marl::mutex impl_; // marl::mutex impl_; std::mutex impl_; friend class ConditionVariable; friend class MutexLock; }; Loading Loading @@ -110,7 +114,8 @@ public: private: friend class ConditionVariable; marl::lock lock_; // marl::lock lock_; std::unique_lock<std::mutex> lock_; }; class ConditionVariable final { Loading Loading @@ -143,10 +148,11 @@ public: } private: marl::ConditionVariable cv_; std::condition_variable cv_; // marl::ConditionVariable cv_; }; class SCOPED_CAPABILITY SharedMutex final { class SharedMutex final { public: enum class Mode { kReaderPriority, Loading Loading
CMakeLists.txt +5 −5 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ add_subdirectory(3party/minilua EXCLUDE_FROM_ALL) if(SLED_WITH_PROTOBUF) add_subdirectory(3party/protobuf-3.21.12 EXCLUDE_FROM_ALL) endif() if(NOT TARGET marl) add_subdirectory(3party/marl EXCLUDE_FROM_ALL) endif() # if(NOT TARGET marl) # add_subdirectory(3party/marl EXCLUDE_FROM_ALL) # endif() if(NOT TARGET rpc_core) add_subdirectory(3party/rpc_core EXCLUDE_FROM_ALL) Loading Loading @@ -106,7 +106,7 @@ target_sources( target_link_libraries( sled PUBLIC rpc_core fmt marl minilua asio PUBLIC rpc_core fmt minilua asio # protobuf::libprotoc PRIVATE dl) # if(CMAKE_SYSTEM_NAME STREQUAL "Linux") target_link_libraries(sled PUBLIC Loading Loading @@ -191,7 +191,7 @@ if(SLED_BUILD_TESTS) src/sled/status_or_test.cc src/sled/strings/utils_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/rx_test.cc src/sled/uri_test.cc) Loading
src/sled/event_bus/event_bus.h +2 −1 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ #include "sled/sigslot.h" #include "sled/synchronization/mutex.h" #include <typeindex> #include <unordered_map> namespace sled { Loading Loading @@ -181,7 +182,7 @@ public: private: 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 #endif// SLED_EVENT_BUS_EVENT_BUS_H
src/sled/network/physical_socket_server.h +11 −11 Original line number Diff line number Diff line Loading @@ -59,9 +59,9 @@ private: bool WaitSelect(int64_t cusWait, bool process_io); uint64_t next_dispatcher_key_ = 0; 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::vector<uint64_t> current_dispatcher_keys_ 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::vector<uint64_t> current_dispatcher_keys_; //GUARDED_BY(lock_); Signaler *signal_wakeup_; // Mutex lock_; RecursiveMutex lock_; Loading Loading @@ -124,7 +124,7 @@ protected: bool udp_; int family_ = 0; mutable Mutex mutex_; int error_ GUARDED_BY(mutex_); int error_;//GUARDED_BY(mutex_); ConnState state_; AsyncResolver *resolver_; Loading
src/sled/sled.h +2 −2 Original line number Diff line number Diff line Loading @@ -65,8 +65,8 @@ #include "sled/synchronization/sequence_checker.h" #include "sled/synchronization/thread_local.h" // system #include "sled/system/fiber/scheduler.h" #include "sled/system/fiber/wait_group.h" // #include "sled/system/fiber/scheduler.h" // #include "sled/system/fiber/wait_group.h" #include "sled/system/location.h" #include "sled/system/thread.h" #include "sled/system/thread_pool.h" Loading
src/sled/synchronization/mutex.h +12 −6 Original line number Diff line number Diff line Loading @@ -11,8 +11,11 @@ #include "sled/lang/attributes.h" #include "sled/units/time_delta.h" #include <chrono> #include <marl/conditionvariable.h> #include <marl/mutex.h> // #include <marl/conditionvariable.h> // #include <marl/mutex.h> #include <atomic> #include <condition_variable> #include <mutex> // #include <condition_variable> // #include <mutex> #include <type_traits> Loading Loading @@ -50,7 +53,8 @@ public: inline void Unlock() SLED_UNLOCK_FUNCTION(impl_) { impl_.unlock(); } private: marl::mutex impl_; // marl::mutex impl_; std::mutex impl_; friend class ConditionVariable; friend class MutexLock; }; Loading Loading @@ -110,7 +114,8 @@ public: private: friend class ConditionVariable; marl::lock lock_; // marl::lock lock_; std::unique_lock<std::mutex> lock_; }; class ConditionVariable final { Loading Loading @@ -143,10 +148,11 @@ public: } private: marl::ConditionVariable cv_; std::condition_variable cv_; // marl::ConditionVariable cv_; }; class SCOPED_CAPABILITY SharedMutex final { class SharedMutex final { public: enum class Mode { kReaderPriority, Loading