Asynchronous Notifications Bug w/ source
Asynchronous Notifications Bug w/ source
- Subject: Asynchronous Notifications Bug w/ source
- From: Jake Repp <email@hidden>
- Date: Tue, 31 Dec 2002 11:56:05 -0800
I finished the test-case for what I currently believe to be a bug in
the handling of async. notifications in Cocoa (according to the
documentation).
Here is the PB project file and source:
http://jrepp.com/src/AsyncNotifications.tgz
You can download the package and see the source for yourself. This
project is setup to do the following:
URLs are grabbed from the url field on 'Execute' and placed onto a work
Queue. There is one worker created at startup who handles this Queue of
URLs to process. The worker is signaled with a semphore and the data of
the queue is protected by a standard lock.
The worker thread grabs the data, packages it up in a NSNotification
and uses the default notification queue for the UI thread to post it
using a configurable style.
There is also a timer that updates the debug info every second so you
can see the status of the worker's queue and the current posting style.
The worker run state is controlled by a conditional lock.
When the posting style is selected as NSPostNow everything works as
expected and you will see the WorkerStartedJob HTMLDidLoad
WorkerFinishedJob notifications. Otherwise you will not ever see these
notifications even though they are posted onto the default notification
queue.
If you break in a debugger you can examine the
NotificationHelper->notificationQueue pointer (try dereferencing it
with 'p *notificationQueue') and you will be able to see the pointers
to the queued up events in the queue that was chosen with the popup.
The code is a little rough (had to hack it together really quick) but
commented and tested.
Please take a look.. I would appreciate any feedback or ideas.
http://jrepp.com/cocoabb/viewtopic.php?t=58
-jake
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.