Multithreading lock implementation demo