2007/9/25, Jerry Richards <[EMAIL PROTECTED]>:
> Could anyone provide me a patch for 1.12.6 so that I can preserve my
> application as shown below? That is, I invoke nua_create/nua_destroy from
> my main application thread, and call su_root_run() from a separate thread,
> as shown below.
I just pushed patch to darcs repo with su_root_release()/su_root_obtain().
A single thread can run (call su_root_step(), su_root_run(), or
su_root_sleep()) the su_root_t object at a time, but now the thread
can be swapped. The su_root_release() unlocks the mutex holding root
and su_root_obtain() locks the mutex ensuring the exclusive run.
So you have to add su_root_release() before calling pthread_create(),
and put su_root_obtain()/su_root_release() around the main loop in
thread function.
--Pekka
> void main(...)
> {
> su_init();
> su_home_init();
> su_root_create();
> su_root_threading();
> nua_create();
> su_root_threading();
> nua_create();
> pthread_create(&main_sip_root_thread, ...); // Creates thread
> that calls
> su_root_run()
> nua_handle();
> nua_register();
> nua_handle();
> nua_register();
> ...
> nua_destroy();
> ...
> }
--
Pekka.Pessi mail at nokia.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel