File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
src/dds.net-connector-cpp.lib/connector/src Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 148148
149149 unregisterVariablesFromServer ();
150150
151- sleep (100 );
151+ sleep_msec (100 );
152152
153153 dataReceiverThread->stop ();
154154
Original file line number Diff line number Diff line change 66#include < thread>
77
88
9- #define sleep (msec ) std::this_thread::sleep_for( std::chrono::milliseconds(msec))
9+ #define sleep_msec (msec ) { std::chrono::milliseconds ms (msec); std::this_thread::sleep_for (ms); }
1010
1111#define CONSOLE_COLOR_FG_BLACK " \033 [0;30m"
1212#define CONSOLE_COLOR_FG_RED " \033 [0;31m"
Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ void dds::net::connector::_internal::continuousThreadFunction(EasyThread* th)
8484
8585 if (doneSomething == false && th->isThreadRunning == true )
8686 {
87- sleep (SLEEP_TIME_WHEN_NOT_DONE_ANYTHING_MSEC);
87+ sleep_msec (SLEEP_TIME_WHEN_NOT_DONE_ANYTHING_MSEC);
8888 }
8989 }
9090}
@@ -97,7 +97,7 @@ void dds::net::connector::_internal::periodicThreadFunction(EasyThread* th)
9797
9898 if (th->isThreadRunning == true )
9999 {
100- sleep (th->periodicity );
100+ sleep_msec (th->periodicity );
101101 }
102102 }
103103}
Original file line number Diff line number Diff line change 239239
240240 if (!doneAnythingInIteration)
241241 {
242- sleep (10 );
242+ sleep_msec (10 );
243243 }
244244 }
245245 } // while (isIOThreadStarted)
330330 std::string error = " Failed to resolve the hostname: " ;
331331 error += this ->ipv4 ;
332332
333- logger->logError (error.c_str ());
333+ logger->error (error.c_str ());
334334 dataLock.unlock ();
335- return false ;
335+ return ;
336336 }
337337
338338 addr_list = (struct in_addr **)he->h_addr_list ;
452452
453453 logger->error (errorMessage.c_str ());
454454
455- sleep (1000 );
455+ sleep_msec (1000 );
456456 }
457457 else
458458 {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ T dds::net::connector::_internal::SyncQueue<T>::dequeue()
7171
7272 lock.unlock ();
7373
74- sleep (SLEEP_TIME_MS_WHEN_DATA_CANNOT_BE_DEQUEUED);
74+ sleep_msec (SLEEP_TIME_MS_WHEN_DATA_CANNOT_BE_DEQUEUED);
7575 }
7676}
7777
@@ -114,7 +114,7 @@ void dds::net::connector::_internal::SyncQueue<T>::enqueue(T data)
114114
115115 lock.unlock ();
116116
117- sleep (SLEEP_TIME_MS_WHEN_DATA_CANNOT_BE_ENQUEUED);
117+ sleep_msec (SLEEP_TIME_MS_WHEN_DATA_CANNOT_BE_ENQUEUED);
118118 }
119119}
120120
You can’t perform that action at this time.
0 commit comments