0
Исправлено

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

Artanov Dmitry 7 年 前 更新人: anonymous 7 年 前 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()

解答

解答
Исправлено

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

解答
Исправлено

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

UserEcho 的客户支持