diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 403baa674c..50c3a011e9 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -3184,7 +3184,7 @@ void MavlinkReceiver::start() pthread_attr_setstacksize(&receiveloop_attr, PX4_STACK_ADJUSTED(sizeof(MavlinkReceiver) + 2840 + MAVLINK_RECEIVER_NET_ADDED_STACK)); - pthread_create(_thread, &receiveloop_attr, MavlinkReceiver::start_trampoline, this); + pthread_create(&_thread, &receiveloop_attr, MavlinkReceiver::start_trampoline, (void *)this); pthread_attr_destroy(&receiveloop_attr); } @@ -3199,5 +3199,5 @@ void *MavlinkReceiver::start_trampoline(void *context) void MavlinkReceiver::stop() { _should_exit.store(true); - pthread_join(*_thread, nullptr); + pthread_join(_thread, nullptr); } diff --git a/src/modules/mavlink/mavlink_receiver.h b/src/modules/mavlink/mavlink_receiver.h index 106426d7b0..b76a2c1a7e 100644 --- a/src/modules/mavlink/mavlink_receiver.h +++ b/src/modules/mavlink/mavlink_receiver.h @@ -226,7 +226,7 @@ private: void update_rx_stats(const mavlink_message_t &message); px4::atomic_bool _should_exit{false}; - pthread_t *_thread {}; + pthread_t _thread {}; Mavlink *_mavlink;