[Live-devel] live555 , pthread, shared library and C/C++

gather bzbz gbzbz at yahoo.com
Sun Jun 1 02:47:03 PDT 2008


1. I have a program that creates pthreads p1,p2,p3,p4 (pure C codes). It works well. Meaning p1,p2,p3,p4 all do their own jobs indepently and correctly.

2. Then I want to add the 5th pthread with live555+wis-streamer. I modify the wis-streamer code so I can compiled it as a shared lib (say live555.so), then I call pthread_create to create a live555 thread. the live555 thread will call wis-streamer's init functions till it hits taskScheduler().doEventLoop();

OK, enough said. All the codes in p1, p2, p3, p4 all are executed, as well as all the codes in p5 (live555 pthread) before the doEventLoop(), correctly. Then once the doEventLoop() starts, all p1, p2 ,p3, p4 go wrong.

3. Then I disable the 5th pthread (live555) by not calling pthread_create there, everything comes back correctly again.

So I guess either doEventLoop() or the marriage of C and C++ codes is doing something funny? Any hints please?


      


More information about the live-devel mailing list