Re: using grand central dispatch with c++ for inter-thread communication
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:received:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=9R95fgu/bWVLz7pvEBZR7YlhrGkWB8/29cs+Q/8pEJ0=; b=RcVZZqRk9kWfj8wD2mASLZwqoBn8xYsaFlgM3jg9JhigWmZZ/vBBT8VVZvDIiuYXvn YCMuALpDurIkvBckD7ov/gm0Cu+o7mBz5Qp67D4aqmM0pkVgQizyqBrrTPqCCokyke52 e5yaUKPu62Uwjl8hsG51nonsfUurq7hiPBwiw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Bnri4uMF+UIMVjTfpTlx7NaYcaHVt+UUex34mdZHjiSAdDqTNI2/pCpNFm49jUvITF rr1XZkNx1gPSdYFKq96aX3YgLS2UkCBPB1zfIftKXTzAPlsKQCpqYhynop8UxtT+LE8z ySCWmmguyU8cREBSv3Rzx/pd1L3JQ4KBN3pTM= On 21 April 2010 12:57, Daniel A. Steffen <dsteffen@apple.com> wrote:
Hi Joel,
On Apr 21, 2010, at 12:05 PM, Joel Reymont wrote:
I looked at using dispatch queues at first but got stuck. This may be just the opportunity to get me over the stumbling block! This is the crucial bit of code that I can't figure out how to translate to dispatch queues:
static IONotificationPortRef __NotifyPort;
// add notification port and run loop source for async notifications
__NotifyPort = IONotificationPortCreate(masterPort);
runLoopSource = IONotificationPortGetRunLoopSource(__NotifyPort); __MeasatRunLoop = CFRunLoopGetCurrent(), CFRunLoopAddSource(__MeasatRunLoop, runLoopSource, kCFRunLoopDefaultMode);
instead of these three lines instead, all that should be needed is
IONotificationPortSetDispatchQueue(__NotifyPort, some_queue)
That's not a public API, see <http://www.opensource.apple.com/source/IOKitUser/IOKitUser-514.8.1/IOKitLibPrivate.h> -- James Peach | jorgar@gmail.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
James Peach