多线程的坑

robot@robot:~/ck_test1_wjw $ rosrun yuyi location
Segmentation fault (core dumped)
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
freeglut  ERROR:  Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
location: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted (core dumped)
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
[xcb] Extra reply data still left in queue
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
location: ../../src/xcb_io.c:576: _XReply: Assertion `!xcb_xlib_extra_reply_data_left' failed.
Aborted (core dumped)
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
location: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Aborted (core dumped)
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
^[[ASegmentation fault (core dumped)

加入多线程之后,也就是pthread_create,主函数的后面一定要跟一些循环语句。。。while(1)什么的。否则会出错。

https://blog.csdn.net/weixin_41931548/article/details/80802340多线程的讲解,加MFC的,挺不错

发布了42 篇原创文章 · 获赞 43 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_34754836/article/details/99619792
今日推荐