Why Nostr? What is Njump?
2023-02-08 09:04:41
in reply to

chenzhiguo on Nostr: class Singleton2 { private static volatile Singleton2 singleton2; private ...

class Singleton2 {
private static volatile Singleton2 singleton2;

private Singleton2(){};

public static Singleton2 getInstance() {
if (singleton2 != null) {
return singleton2;
}
synchronized (Singleton2.class) {
singleton2 = new Singleton2();
}
return singleton2;
}
}
这个线程安全吗?
Author Public Key
npub14t5ulke3z0d5gtq6mr2vvu9zszg72fnhfrn36tq7rz0yy0d75xlsch5jn7