From 5354c10742b008f4081004ea22d7bc52a0e47fba Mon Sep 17 00:00:00 2001 From: Francis <455954986@qq.com> Date: Mon, 6 Jul 2020 19:26:11 +0800 Subject: [PATCH] Update README.md --- design_pattern/singleton/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design_pattern/singleton/README.md b/design_pattern/singleton/README.md index f593319..73bbf40 100644 --- a/design_pattern/singleton/README.md +++ b/design_pattern/singleton/README.md @@ -164,7 +164,7 @@ p = new singleton; - 线程A调用instance,执行第一次p的测试,获得锁,按照1,3,执行,然后被挂起。此时p是非空的,但是p指向的内存中还没有Singleton对象被构造。 - 线程B调用instance,判定p非空, 将其返回给instance的调用者。调用者对指针解引用以获得singleton,噢,一个还没有被构造出的对象。bug就出现了。 -DCLP能够良好的工作仅当步骤一和二在步骤三之前被执行,但是并没有并没有方法在C或C++中表达这种限制。这就像是插在DCLP心脏上的一把匕首:我们需要在相对指令顺序上定义限制,但是我们的语言没有给出表达这种限制的方法。 +DCLP能够良好的工作仅当步骤一和二在步骤三之前被执行,但是并没有方法在C或C++中表达这种限制。这就像是插在DCLP心脏上的一把匕首:我们需要在相对指令顺序上定义限制,但是我们的语言没有给出表达这种限制的方法。 ## 5.memory barrier指令 @@ -324,4 +324,4 @@ public: > https://www.cnblogs.com/liyuan989/p/4264889.html -> https://segmentfault.com/a/1190000015950693 \ No newline at end of file +> https://segmentfault.com/a/1190000015950693