Failed to create singleton class as part of IOKit based kext driver.
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=mFag9/vbu3BKfCJJJpeYmB0FcYD42g31dLWOw0X83pM=; b=GbwRvjv91LnwcInA2iDfBgJ8xzjHfdv9PPiWWIGV2xD0iIkaVRby4j2+DFmxfJHCiu K7KQuzh+lOCoyGqrNokZUsNocik5wU3mTGu2LI0EeHiyuwA7AjjJ2xq5ftViAbSta/Ul 3MF9q3587T37GEAVD54n3DegcQqdvWAReI3KNlyr+fdwjCrC/koKqa00fEUqTVZWyZwc E7TfqLztr0ASZ8+9bSjYYkOuUYmYFCEZNQKbLOCNI6LlX8RJXioTZNHbfE7kFcBs3oyG Y2Sqcpeld7AyHGOFFG6XD64xclU07SGCqjP6mqBDpbceEvcFwlAmq+NqcQpLNGztbbW6 iZKQ== Hi, I've built a wrapper class for the IOKit object from type IOSharedDataQueue, since I use this Since this class is shared to many other object in my code, I've decided to make it a singleton. I've added the getInstance function to support singleton pattern : myclass& myclass::getInstance() { static myclass instance; return instance; } However, it seems that c++11 way of initialize singleton should work in IOKit compiler, and Xcode produces the following error : This initialization requires a guard variable, which the kernel does not support The thing is, that it works for classes that does't contain IOKIt objects. Perhaps anyone encounter this issue, I haven't seen any documentation of this limitation. thanks _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com
participants (1)
-
Irad K