2008/11/20 Andrew Rechenberg Lists <[EMAIL PROTECTED]>:
> Replying to myself in hope that it helps someone else and for posterity.
>
> I think I fixed my issue. I used su_root_step in my thread loop instead
> of su_root_run. So now my pseudo code looks like:
>
> AppSingleton *myapp;
> su_init()
> su_home_t *tmp
> tmp = su_home_new()
> myapp->home = tmp;
> su_home_init(myapp->home)
> myapp->root = su_root_osx_runloop_create(*myapp)
> nua_create(...)
> su_root_release(myapp->root)
> pthread_create(thread,NULL,root_thread,NULL)
>
> void root_thread() {
> AppSingleton *myapp;
> su_root_obtain(myapp->root);
> su_root_osx_prepare_run(myapp->root);
> while (1) {
> su_root_step(myapp->root, 20);
> }
> su_root_release)(myapp->root);
> }
>
> If anyone sees an issue with running the event loop in this fashion,
> please advise me. I'd like to write it in the proper fashion, but this
> works and does what I want.
I must confess that I remember nothing of CoreFoundation mainloop so I
can't comment on your problem.
It is fine run mainloop like that, however perhaps you should use much
longer timeout in su_root_step(), like 15000 or so? Waking up every 20
milliseconds in a mobile device is not very battery-friendly...
--
Pekka.Pessi mail at nokia.com
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel