Re: Notification handling without run loop of a primary thread
Re: Notification handling without run loop of a primary thread
- Subject: Re: Notification handling without run loop of a primary thread
- From: Brian Bergstrand <email@hidden>
- Date: Fri, 2 Dec 2005 15:37:40 -0600
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Dec 2, 2005, at 3:08 PM, Vladimir Magaziy wrote:
Hi all,
I am trying to handle distributed notifications in a
CoreFoundation Tool
that does not run a run loop of its primary thread (actually,
it is
the requirement). I can not find any solution that works, so I
ask you
about possibility to do in general.
I thought that it is possible to track notifications using a
run loop of
a separate thread (see code snippet below), but CFRunLoopRun
function does not run a thread run loop, it simply returns a
control
and a thread finishes. I guess that I do not initialize a
thread run loop
correctly, so please suggest me the appropriate way to run it
and force
to handle notifications.
The run loop needs an event source or it will just exit (as you
witnessed). So, before calling CFRunLoopRun() you should register
your notification handler with the run loop.
HTH.
Brian Bergstrand
<http://www.bergstrand.org/brian/> PGP Key ID: 0xB6C7B6A2
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
iD8DBQFDkL6qedHYW7bHtqIRAkNvAJ9vdNCt63GsLk0eTNzReiXsWXeIrgCgygkb
wup2rTUyHJZTcVkF2xMkyXA=
=p17F
-----END PGP SIGNATURE-----
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden