Skip to content

James-Lua/Threads-and-Singletons

Repository files navigation

Threads-and-Singletons

Printouts:

Test 1 (Before fix) Thread 30 - HashCode: 985777155 Thread 31 - HashCode: 1823044275 Thread 32 - HashCode: 985777155

Test 2 (After fix) Thread 32 - HashCode: 1887294649 Thread 31 - HashCode: 1887294649 Thread 30 - HashCode: 1887294649

Test 3 (After fix) Thread 32 - HashCode: 1887294649 Thread 31 - HashCode: 1887294649 Thread 30 - HashCode: 1887294649

All threads are printing the same hash code, meaning threads are synchronized.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages