Skip to content

Commit 7596166

Browse files
committed
workarounds
1 parent ad53544 commit 7596166

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

libmamba/include/mamba/core/logging.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace mamba
7171
}
7272

7373
/// @returns All `log_source` values as a range.
74-
inline constexpr auto all_log_sources() noexcept -> std::vector<log_source>
74+
inline constexpr auto all_log_sources() noexcept -> std::initializer_list<log_source>
7575
{
7676
return { log_source::libmamba, log_source::libcurl, log_source::libsolv };
7777
}

libmamba/src/core/logging.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ namespace mamba::logging
2424
// dont accept `constinit` here, so until this is fixed we'll lose performance using
2525
// `std::mutex` when we mostly are reading data, not modifying,
2626
// but at least we maintain correctness and avoid static-init fiasco.
27-
constinit util::synchronized_value<LoggingParams, std::mutex> logging_params;
27+
#if defined(__APPLE__)
28+
using params_mutex = std::mutex;
29+
#else
30+
using params_mutex = std::shared_mutex;
31+
#endif
32+
constinit util::synchronized_value<LoggingParams, params_mutex> logging_params;
2833

2934
// IMPRTANT NOTE:
3035
// The handler MUST NOT be protected from concurrent calls at this level

0 commit comments

Comments
 (0)