多线程的坑

robot@robot:~/ck_test1_wjw $ rosrun yuyi location
Segmentation fault (core dumped)
robot@robot:~/ck_test1_wjw $ rosrun yuyi location
freeglut  ERROR:  Internal error  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)什么的。否则会出错。

你可能感兴趣的:(linux)