Annotation of mystuff-orcaslicer/cad/orcaslicer/patches/patch-src_libslic3r_GCodeSender_cpp, Revision 1.1.1.1
1.1 afresh1 1: From: https://github.com/slic3r/Slic3r/issues/5197
2:
3: Index: src/libslic3r/GCodeSender.cpp
4: --- src/libslic3r/GCodeSender.cpp.orig
5: +++ src/libslic3r/GCodeSender.cpp
6: @@ -104,10 +104,10 @@ GCodeSender::connect(std::string devname, unsigned int
7:
8: // this gives some work to the io_service before it is started
9: // (post() runs the supplied function in its thread)
10: - this->io.post(boost::bind(&GCodeSender::do_read, this));
11: + boost::asio::post(this->io, [this]() { this->do_read(); });
12:
13: // start reading in the background thread
14: - boost::thread t(boost::bind(&boost::asio::io_service::run, &this->io));
15: + boost::thread t(boost::bind(&boost::asio::io_context::run, &this->io));
16: this->background_thread.swap(t);
17:
18: // always send a M105 to check for connection because firmware might be silent on connect
19: @@ -164,9 +164,9 @@ GCodeSender::disconnect()
20: if (!this->open) return;
21: this->open = false;
22: this->connected = false;
23: - this->io.post(boost::bind(&GCodeSender::do_close, this));
24: + boost::asio::post(this->io, [this]() { this->do_read(); });
25: this->background_thread.join();
26: - this->io.reset();
27: + this->io.restart();
28: /*
29: if (this->error_status()) {
30: throw(boost::system::system_error(boost::system::error_code(),
31: @@ -457,7 +457,7 @@ GCodeSender::send(const std::string &line, bool priori
32: void
33: GCodeSender::send()
34: {
35: - this->io.post(boost::bind(&GCodeSender::do_send, this));
36: + boost::asio::post(this->io, [this]() { this->do_send(); });
37: }
38:
39: void
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>