Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
external
sofia-sip
Commits
f0ee9c80
Commit
f0ee9c80
authored
Feb 09, 2007
by
Martti Mela
Browse files
su_osx_runloop.c: optimized su_osx_port_step()
darcs-hash:20070209163525-1b897-5dad02f46e9b0e6a6840e9196ad34da8c046be14.gz
parent
129561a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
libsofia-sip-ua/su/su_osx_runloop.c
View file @
f0ee9c80
...
...
@@ -284,10 +284,11 @@ su_port_t *su_osx_runloop_create(void)
CFRunLoopObserverCreate
(
NULL
,
kCFRunLoopAfterWaiting
|
kCFRunLoopBeforeWaiting
,
TRUE
,
0
,
cf_observer_cb
,
self
->
sup_observer_cntx
);
#if 0
CFRunLoopAddObserver(CFRunLoopGetCurrent(),
self->sup_observer,
kCFRunLoopDefaultMode);
#endif
}
else
return
su_home_unref
(
su_port_home
(
self
)),
NULL
;
...
...
@@ -1234,8 +1235,6 @@ su_duration_t su_osx_port_step(su_port_t *self, su_duration_t tout)
CFAbsoluteTime
start
;
int
ret
,
timeout
=
tout
>
INT32_MAX
?
INT32_MAX
:
tout
;
// XXX - mela assert(SU_OSX_PORT_OWN_THREAD(self));
rl
=
CFRunLoopGetCurrent
();
if
(
!
rl
)
...
...
@@ -1259,27 +1258,12 @@ su_duration_t su_osx_port_step(su_port_t *self, su_duration_t tout)
if
(
self
->
sup_base
->
sup_head
)
tout
=
0
;
start
=
CFAbsoluteTimeGetCurrent
();
for
(;;)
{
/* Run loop with only one pass, indicate if a source was processed */
ret
=
CFRunLoopRunInMode
(
kCFRunLoopDefaultMode
,
0
,
TRUE
);
ret
=
CFRunLoopRunInMode
(
kCFRunLoopDefaultMode
,
tout
/
1000
,
TRUE
);
/* Ok, one of our sources was fired */
if
(
self
->
sup_source_fired
==
1
)
{
self
->
sup_source_fired
=
0
;
break
;
}
CFRunLoopWakeUp
(
rl
);
#if 0
/* Check how long to run this loop */
if (CFAbsoluteTimeGetCurrent() >= start + timeout / 10000)
#else
break
;
#endif
}
if
(
self
->
sup_base
->
sup_head
)
su_base_port_getmsgs
(
self
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment