Re: Bluetooth and runloops in a dedicated thread.
site_archiver@lists.apple.com Delivered-To: bluetooth-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=E90XZF4EQhLQgKIzPRbxO16d0kCcRV9u9Bw1D/neq7E=; b=HEgnl3JeyvCsSkUdDpw3fR10okEcL42PaA8kHEj7u/DE7GqmrPvCCcYs8JNOWRSvp/ wKJL5FOLch9l7q8ZnUTqSZA+2s6hjZyGCBYFgkZEFNnSfUINfJnHNS6WIKeZtV6LZ7w3 o4RUJsS9xBe9eIKW0jelabYkHxFCJrlgPiY4M= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=lx4W7beGPOSGL8wkXnZ5KkEeY+UkQCEzObtCSn78vBKW9Nes1Wtcq0Fu/evbn/QGB+ fXbAQE4cs1rbOigUmfgwHJ4s8s1Yx7VVWVzNd59MfrYdj8eHey8iGP12lZGjuhw3Pmfx UYI+MpsedCHLFww2rOGQaxO47381ZRjSTj17A=
I have an old project that I am restarting, and under Snow Leopard it is broke. The problem didn't have a well documented solution in older OSes. I am hoping to get some guidance. I would like to have a dedicated thread for every IOBluetoothDevice/IOBluetoothRFCOMMChannel pair. The runloop below exits immediately. IOBluetoothValidateHardware used to perform enough side-effect magic to keep the runloop running. What should startBlueToothThread look like?
To my knowledge, no part of the Bluetooth frameworks documentation says anything about thread safety, and for that reason you must assume that it is only safe to use from the main thread. Also, a thread's run loop will only run if it has either run loop sources or timers attached; the fact that NSRunLoop's -run ever returns means that it has neither. This is what I would expect based on your -startBlueToothThread: method, as it doesn't appear to create a source or timer. If you wanted to keep the thread alive, I would attach a dummy timer to the run loop that fires after some extraordinary amount of time. (Assuming you're not using the Bluetooth APIs on the thread...) _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dave Keck