Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[19797] Custom eprosima::thread class that allows setting the stack size #4000

Merged
merged 22 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f3f2ca4
Refs #19797. Initial refactor. eprosima::thread inherits from std::th…
MiguelCompany Oct 30, 2023
74d0b06
Refs #19797. Update code in ResourceEvent.
MiguelCompany Oct 30, 2023
e9e50f4
Refs #19797. Using eprosima::thread instead of std::thread.
MiguelCompany Oct 30, 2023
f998ade
Refs #19797. Include `<thread>` where `std::this_thread` is used.
MiguelCompany Oct 30, 2023
c186431
Refs #19797. Copy basic eprosima::thread implementation into ipp files.
MiguelCompany Oct 30, 2023
a7ad042
Refs #19797. Select ipp file depending on platform.
MiguelCompany Oct 30, 2023
ca60005
Refs #19797. Copy windows implementation on `thread_impl_win32.ipp`
MiguelCompany Oct 31, 2023
5bcfb4f
Refs #19797. Added `is_calling_thread method`.
MiguelCompany Oct 31, 2023
3e6be87
Refs #19797. Using `is_calling_thread` instead of comparing ids.
MiguelCompany Oct 31, 2023
ec315e8
Refs #19797. Using stack size argument.
MiguelCompany Oct 31, 2023
490acfb
Refs #19797. Update test.
MiguelCompany Oct 31, 2023
7dd276f
Refs #19797. Implementation for pthread based platforms.
MiguelCompany Nov 7, 2023
a01c832
Refs #19797. Use pthread based implementation on Mac.
MiguelCompany Nov 8, 2023
34547b8
Refs #19797. Change windows implementation approach.
MiguelCompany Nov 8, 2023
310f55c
Refs #19797. Factor out common code.
MiguelCompany Nov 10, 2023
6fa8d6f
Refs #19797. Linter
MiguelCompany Nov 10, 2023
1738720
Refs #19797. Use local `swap` method.
MiguelCompany Nov 10, 2023
c109d25
Refs #19797. Pass 0 value to `pthread_attr_setstacksize`.
MiguelCompany Nov 10, 2023
c1700e7
Refs #19797. Linter
MiguelCompany Nov 10, 2023
b320faa
Refs #19797. Improve include what you use.
MiguelCompany Nov 10, 2023
12245f2
Refs #19797. Add missing includes
EduPonz Nov 10, 2023
d1a5b0e
Refs #19797. Fix thread settings on dds unit test xml profiles.
MiguelCompany Nov 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

#include "deadlinepayloadPublisher.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/

#include "DisablePositiveACKsSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <condition_variable>
#include <csignal>
#include <mutex>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h>
Expand Down
17 changes: 10 additions & 7 deletions examples/cpp/dds/DynamicHelloWorldExample/HelloWorldSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <mutex>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/SubscriberAttributes.h>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

#include <fastrtps/types/DynamicDataHelper.hpp>
#include <fastrtps/types/DynamicDataFactory.h>
#include <mutex>
#include <fastrtps/types/DynamicDataHelper.hpp>

using namespace eprosima::fastdds::dds;
using eprosima::fastrtps::types::ReturnCode_t;
Expand Down
7 changes: 5 additions & 2 deletions examples/cpp/dds/Filtering/FilteringExamplePublisher.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

#include "FilteringExamplePublisher.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastrtps::rtps;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
* This file was generated by the tool fastcdrgen.
*/

#include "FlowControlExamplePublisher.h"

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <chrono>
#include <thread>

#include "FlowControlExamplePublisher.h"
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastrtps::rtps;
Expand Down
4 changes: 4 additions & 0 deletions examples/cpp/dds/HelloWorldExample/HelloWorldSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <thread>

#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/SubscriberAttributes.h>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
*/

#include "HelloWorldSubscriber.h"
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/SubscriberAttributes.h>

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/SubscriberAttributes.h>

using namespace eprosima::fastdds::dds;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/rtps/transport/shared_mem/SharedMemTransportDescriptor.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include "HelloWorldPublisher.h"
#include "HelloWorldSubscriber.h"

#include <thread>

#include <fastrtps/Domain.h>
#include <fastrtps/log/Log.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/rtps/transport/TCPv4TransportDescriptor.h>
Expand Down
8 changes: 5 additions & 3 deletions examples/cpp/dds/HistoryKind/pastsamples.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#include <chrono>
#include <iostream>
#include <string>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "samplePubSubTypes.h"
Expand Down
14 changes: 8 additions & 6 deletions examples/cpp/dds/Keys/keys.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#include <chrono>
#include <condition_variable>
#include <iostream>
#include <string>
#include <condition_variable>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "samplePubSubTypes.h"
Expand Down
12 changes: 7 additions & 5 deletions examples/cpp/dds/LateJoiners/latejoiners.cpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#include <iostream>
#include <string>
#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "samplePubSubTypes.h"
Expand Down
5 changes: 4 additions & 1 deletion examples/cpp/dds/LifespanQoSExample/LifespanSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

#include "LifespanSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastrtps::rtps;
Expand Down
5 changes: 4 additions & 1 deletion examples/cpp/dds/LivelinessQoS/LivelinessSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@

#include "LivelinessSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastrtps::rtps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@

#include "OwnershipStrengthPublisher.h"

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

#include <chrono>
#include <sstream>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

using namespace eprosima::fastdds::dds;
using namespace eprosima::fastrtps::rtps;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#include <iostream>
#include <string>
#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>


#include "samplePubSubTypes.h"

using namespace eprosima::fastdds::dds;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#include <chrono>
#include <iostream>
#include <string>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "samplePubSubTypes.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#include <iostream>
#include <string>
#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipant.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/publisher/DataWriter.hpp>
#include <fastdds/dds/publisher/DataWriterListener.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>
#include <fastdds/dds/subscriber/DataReader.hpp>
#include <fastdds/dds/subscriber/DataReaderListener.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/topic/Topic.hpp>

#include "samplePubSubTypes.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
*/

#include "HelloWorldPublisher.h"
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/domain/qos/DomainParticipantQos.hpp>
#include <fastdds/dds/publisher/Publisher.hpp>

using namespace eprosima::fastdds::dds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
*/

#include "HelloWorldSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>


using namespace eprosima::fastdds::dds;

HelloWorldSubscriber::HelloWorldSubscriber()
Expand Down
15 changes: 9 additions & 6 deletions examples/cpp/dds/TypeLookupService/TypeLookupSubscriber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@
*/

#include "TypeLookupSubscriber.h"

#include <chrono>
#include <thread>

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastrtps/attributes/ParticipantAttributes.h>
#include <fastrtps/attributes/SubscriberAttributes.h>
#include <fastdds/dds/subscriber/Subscriber.hpp>
#include <fastdds/dds/subscriber/SampleInfo.hpp>
#include <fastdds/dds/subscriber/qos/DataReaderQos.hpp>
#include <fastdds/dds/domain/DomainParticipantFactory.hpp>

#include <fastrtps/types/DynamicDataHelper.hpp>
#include <fastrtps/types/DynamicDataFactory.h>
#include <fastrtps/types/DynamicDataHelper.hpp>
#include <fastrtps/types/TypeObjectFactory.h>

using namespace eprosima::fastdds::dds;
Expand Down
Loading
Loading