0
Исправлено

Реализация одиночки (singleton)

Artanov Dmitry hace 7 años actualizado por anonymous hace 7 años 1

Нужно в псевдокод

static method getInstance() is

        if (this.instance == null) then
            acquireThreadLock() and then
                this.instance = new Singleton()

добавить ещё одну проверку

static method getInstance() is

        if (this.instance == null) then
            acquireThreadLock() and then
                if (this.instance == null) then
                    this.instance = new Singleton()

Respuesta

Respuesta
Исправлено

Исправил, спасибо!

Respuesta
Исправлено

Исправил, спасибо!