Add sample code on sync threading

The multithreads are now executing synchronised method which take a
right order - producer never produces unless consumer has consumed the
previous value and consumer never consumes until producer has produced a
new value