From 3542f03b3d104ae569facec22f1c9088cbaf42d6 Mon Sep 17 00:00:00 2001 From: Peter Andreas Entschev Date: Mon, 27 Jan 2025 14:18:22 +0100 Subject: [PATCH] Remove `std::mutex()` from list-initialization (#355) Remove the `std::mutex()` constructor call from list-initialization in `ucxx::Endpoint`. This is totally unnecessary and may cause issues with some compilers (or compiler options): ``` ... error: function "std::mutex::mutex(const std::mutex &)" (declared at line 94 of /opt/conda/envs/base/lib/gcc/x86_64-conda-linux-gnu/11.4.0/include/c++/bits/std_mutex.h) cannot be referenced -- it is a deleted function ``` Authors: - Peter Andreas Entschev (https://github.com/pentschev) Approvers: - Sebastian Berg (https://github.com/seberg) - Mads R. B. Kristensen (https://github.com/madsbk) URL: https://github.com/rapidsai/ucxx/pull/355 --- cpp/include/ucxx/endpoint.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/include/ucxx/endpoint.h b/cpp/include/ucxx/endpoint.h index e54426db..b92cb0b7 100644 --- a/cpp/include/ucxx/endpoint.h +++ b/cpp/include/ucxx/endpoint.h @@ -55,9 +55,9 @@ class Endpoint : public Component { bool _endpointErrorHandling{true}; ///< Whether the endpoint enables error handling std::unique_ptr _inflightRequests{ std::make_unique()}; ///< The inflight requests - std::mutex _mutex{std::mutex()}; ///< Mutex used during close to prevent race conditions between - ///< application thread and `ucxx::Endpoint::setCloseCallback()` - ///< that may run asynchronously on another thread. + std::mutex _mutex{}; ///< Mutex used during close to prevent race conditions between + ///< application thread and `ucxx::Endpoint::setCloseCallback()` + ///< that may run asynchronously on another thread. ucs_status_t _status{UCS_INPROGRESS}; ///< Endpoint status std::atomic _closing{false}; ///< Prevent calling close multiple concurrent times. EndpointCloseCallbackUserFunction _closeCallback{nullptr}; ///< Close callback to call