Is the Meyers' implementation of the Singleton pattern valid in vxWorks?

33 Views Asked by At

I'm developing a logging utility for my project in vxWorks 7.
I'm creating a plog like API.
I wanted to is the Meyers' implementation of the Singleton pattern valid in vxWorks?
Is Meyers' implementation of the Singleton pattern task/thread safe in vxWorks?

Code :

class Logging
    {
    public:
        static Logging& instance()
        {
            static Logging instance;
            return instance;
        }
    private:
        Logging() = default;
        ~Logging() = default;
        Logging(const Logging&) = delete; //Delete/Disable Copy Constructor
        Logging& operator=(const Logging&) = delete; //Delete/Disable Assignment Operation
    };
0

There are 0 best solutions below