Failed to create singleton class as part of IOKit based kext driver.
Failed to create singleton class as part of IOKit based kext driver.
- Subject: Failed to create singleton class as part of IOKit based kext driver.
- From: Irad K <email@hidden>
- Date: Thu, 24 May 2018 14:39:04 +0300
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 (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden