mthli / blog

Yet another blog of myself 👀
https://mthli.xyz
MIT License
42 stars 4 forks source link

double-checked-locking-singleton/ #8

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

双重检查锁的单例实现

关键字 volatile 的作用是禁止指令重排。

https://mthli.xyz/double-checked-locking-singleton/

REBOOTERS commented 3 years ago

👍🏻