Skip to content

Commit

Permalink
Replace boost::this_thread::sleep by std::this_thread::sleep_for
Browse files Browse the repository at this point in the history
  • Loading branch information
Heiko Thiel committed Mar 13, 2019
1 parent 8eea9bc commit 57e6024
Show file tree
Hide file tree
Showing 91 changed files with 281 additions and 167 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@
#include <boost/signals2/connection.hpp>
//#include <boost/signals2/signal.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <boost/type_traits/is_same.hpp>
6 changes: 0 additions & 6 deletions apps/include/pcl/apps/impl/dominant_plane_segmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
*
*/

#ifndef Q_MOC_RUN
#pragma once
#include <boost/thread/thread.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#endif

#include <pcl/apps/dominant_plane_segmentation.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <pcl/features/integral_image_normal.h>
Expand Down
7 changes: 1 addition & 6 deletions apps/include/pcl/apps/manual_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@

#include <ui_manual_registration.h>

// QT4
// QT
#include <QMainWindow>
#include <QMutex>
#include <QTimer>

// Boost
#ifndef Q_MOC_RUN
#include <boost/thread/thread.hpp>
#endif

// PCL
#include <pcl/console/print.h>
#include <pcl/console/parse.h>
Expand Down
2 changes: 0 additions & 2 deletions apps/include/pcl/apps/organized_segmentation_demo.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@

#include <pcl/apps/organized_segmentation_demo_qt.h>

// Boost
#include <boost/thread/thread.hpp>
// PCL
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
Expand Down
1 change: 0 additions & 1 deletion apps/include/pcl/apps/pcd_video_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
#include <QTimer>

// Boost
#include <boost/thread/thread.hpp>
#include <boost/filesystem.hpp>

// PCL
Expand Down
6 changes: 5 additions & 1 deletion apps/src/dinast_grabber_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@
*
*/

#include <thread>

#include <pcl/common/time.h>
#include <pcl/point_types.h>
#include <pcl/io/dinast_grabber.h>
#include <pcl/visualization/cloud_viewer.h>

using namespace std::chrono_literals;

template <typename PointType>
class DinastProcessor
{
Expand Down Expand Up @@ -79,7 +83,7 @@ class DinastProcessor

while (!viewer.wasStopped())
{
boost::this_thread::sleep (boost::posix_time::seconds (1));
std::this_thread::sleep_for(1s);
}

interface.stop ();
Expand Down
6 changes: 5 additions & 1 deletion apps/src/ni_agast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/

#define SHOW_FPS 1

#include <thread>

#include <pcl/apps/timer.h>
#include <pcl/common/common.h>
#include <pcl/common/angles.h>
Expand All @@ -53,6 +56,7 @@

using namespace pcl;
using namespace std;
using namespace std::chrono_literals;

typedef PointUV KeyPointT;

Expand Down Expand Up @@ -311,7 +315,7 @@ class AGASTDemo

cloud_viewer_.spinOnce ();
image_viewer_.spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100));
std::this_thread::sleep_for(100us);
}

grabber_.stop ();
Expand Down
6 changes: 5 additions & 1 deletion apps/src/ni_brisk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/

#define SHOW_FPS 1

#include <thread>

#include <pcl/apps/timer.h>
#include <pcl/common/common.h>
#include <pcl/common/angles.h>
Expand All @@ -53,6 +56,7 @@

using namespace pcl;
using namespace std;
using namespace std::chrono_literals;

typedef PointXYZRGBA PointT;
typedef PointWithScale KeyPointT;
Expand Down Expand Up @@ -268,7 +272,7 @@ class BRISKDemo

cloud_viewer_.spinOnce ();
image_viewer_.spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100));
std::this_thread::sleep_for(100us);
}

grabber_.stop ();
Expand Down
5 changes: 4 additions & 1 deletion apps/src/ni_linemod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
*
*/

#include <thread>

#include <pcl/apps/timer.h>
#include <pcl/common/common.h>
#include <pcl/common/angles.h>
Expand Down Expand Up @@ -64,6 +66,7 @@

using namespace pcl;
using namespace std;
using namespace std::chrono_literals;

typedef PointXYZRGBA PointT;

Expand Down Expand Up @@ -527,7 +530,7 @@ class NILinemod
cloud_viewer_.spinOnce ();

image_viewer_.spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100));
std::this_thread::sleep_for(100us);
}

grabber_.stop ();
Expand Down
6 changes: 5 additions & 1 deletion apps/src/ni_susan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/

#define SHOW_FPS 1

#include <thread>

#include <pcl/apps/timer.h>
#include <pcl/common/common.h>
#include <pcl/common/angles.h>
Expand All @@ -52,6 +55,7 @@

using namespace pcl;
using namespace std;
using namespace std::chrono_literals;

typedef PointXYZRGBA PointT;
typedef PointXYZRGBL KeyPointT;
Expand Down Expand Up @@ -172,7 +176,7 @@ class SUSANDemo

cloud_viewer_.spinOnce ();
image_viewer_.spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100));
std::this_thread::sleep_for(100us);
}

grabber_.stop ();
Expand Down
6 changes: 5 additions & 1 deletion apps/src/ni_trajkovic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
*/

#define SHOW_FPS 1

#include <thread>

#include <pcl/apps/timer.h>
#include <pcl/common/common.h>
#include <pcl/io/openni_grabber.h>
Expand All @@ -48,6 +51,7 @@
#include <pcl/console/print.h>
#include <pcl/console/parse.h>

using namespace std::chrono_literals;
using namespace pcl;
typedef PointXYZRGBA PointT;
typedef PointXYZI KeyPointT;
Expand Down Expand Up @@ -192,7 +196,7 @@ class TrajkovicDemo

cloud_viewer_.spinOnce ();
image_viewer_.spinOnce ();
boost::this_thread::sleep (boost::posix_time::microseconds (100));
std::this_thread::sleep_for(100us);
}

grabber_.stop ();
Expand Down
7 changes: 5 additions & 2 deletions apps/src/openni_3d_concave_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*
*/

#include <thread>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/openni_grabber.h>
Expand All @@ -47,6 +49,7 @@
using namespace pcl;
using namespace pcl::visualization;
using namespace std;
using namespace std::chrono_literals;

#define FPS_CALC(_WHAT_) \
do \
Expand Down Expand Up @@ -106,7 +109,7 @@ class OpenNI3DConcaveHull
{
if (!cloud_ || !new_cloud_)
{
boost::this_thread::sleep (boost::posix_time::milliseconds (1));
std::this_thread::sleep_for(1ms);
return;
}

Expand Down Expand Up @@ -145,7 +148,7 @@ class OpenNI3DConcaveHull

while (!viewer.wasStopped ())
{
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
std::this_thread::sleep_for(1ms);
}

interface->stop ();
Expand Down
9 changes: 6 additions & 3 deletions apps/src/openni_3d_convex_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
*
*/

#include <thread>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/openni_grabber.h>
Expand All @@ -44,9 +46,10 @@
#include <pcl/common/time.h>
#include <pcl/visualization/cloud_viewer.h>

using namespace std;
using namespace std::chrono_literals;
using namespace pcl;
using namespace pcl::visualization;
using namespace std;

#define FPS_CALC(_WHAT_) \
do \
Expand Down Expand Up @@ -104,7 +107,7 @@ class OpenNI3DConvexHull
{
if (!cloud_ || !new_cloud_)
{
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
std::this_thread::sleep_for(1ms);
return;
}

Expand Down Expand Up @@ -143,7 +146,7 @@ class OpenNI3DConvexHull

while (!viewer.wasStopped ())
{
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
std::this_thread::sleep_for(1ms);
}

interface->stop ();
Expand Down
10 changes: 7 additions & 3 deletions apps/src/openni_boundary_estimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*
*/

#include <thread>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/openni_grabber.h>
Expand All @@ -47,6 +49,8 @@
#include <pcl/common/time.h>
#include <pcl/visualization/cloud_viewer.h>

using namespace std::chrono_literals;

typedef pcl::visualization::PointCloudColorHandler<pcl::PCLPointCloud2> ColorHandler;
typedef ColorHandler::Ptr ColorHandlerPtr;
typedef ColorHandler::ConstPtr ColorHandlerConstPtr;
Expand Down Expand Up @@ -123,7 +127,7 @@ class OpenNIIntegralImageNormalEstimation
boost::mutex::scoped_lock lock (mtx_);
if (!cloud_)
{
boost::this_thread::sleep(boost::posix_time::seconds(1));
std::this_thread::sleep_for(1s);
return;
}

Expand Down Expand Up @@ -163,7 +167,7 @@ class OpenNIIntegralImageNormalEstimation

while (!viewer.wasStopped ())
{
boost::this_thread::sleep(boost::posix_time::seconds(1));
std::this_thread::sleep_for(1s);
}

interface->stop ();
Expand Down
6 changes: 5 additions & 1 deletion apps/src/openni_change_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
* Author: Nico Blodow (blodow@cs.tum.edu), Julius Kammerl (julius@kammerl.de)
*/

#include <thread>

#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <pcl/io/openni_grabber.h>
Expand All @@ -44,6 +46,8 @@

#include <pcl/console/parse.h>

using namespace std::chrono_literals;

enum
{
REDDIFF_MODE,
Expand Down Expand Up @@ -128,7 +132,7 @@ class OpenNIChangeViewer

while (!viewer.wasStopped())
{
boost::this_thread::sleep(boost::posix_time::seconds(1));
std::this_thread::sleep_for(1s);
}

interface->stop ();
Expand Down
Loading

0 comments on commit 57e6024

Please sign in to comment.