abuicke / SolitaryFitness

Companion app to Solitary Fitness by Charles Bronson
1 stars 0 forks source link

Do I need to redo how I write the getInstance pattern? #70

Open abuicke opened 7 months ago

abuicke commented 7 months ago

Do I need to redo how I write the getInstance pattern?

https://stackoverflow.com/questions/35587652/kotlin-thread-safe-native-lazy-singleton-with-parameter https://en.wikipedia.org/wiki/Initialization-on-demand_holder_idiom#Example_Java_Implementation https://stackoverflow.com/questions/17799976/why-is-static-inner-class-singleton-thread-safe/17800038 https://stackoverflow.com/questions/6109896/singleton-pattern-bill-pughs-solution

abuicke commented 7 months ago

Is @Volatile required on singleton pattern? https://stackoverflow.com/questions/59208041/do-we-need-volatile-when-implementing-singleton-using-double-check-locking