[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSThread Comparisons

From: Justin Kendrick
Subject: NSThread Comparisons
Date: Thu, 3 Jan 2008 16:11:00 -0800

I'm writing a class which needs to determine the current thread and get an object tied to that thread. I'd like to use an NSDictionary keyed by an NSThread object, but NSThread instances not copyable (and I can't find any good documentation on how NSDictionary matches non- NSString keys anyway). Beyond that, I thought that I might use an NSValue created with valueWithUnretainedObject:, but that feels really hackish.

For that matter, is there a one-to-one mapping between NSThread instances and Posix threads -- that is, can I compare two NSThread pointers and conclude that the NSThread instances do or do not represent the same thread?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]