introduce CLock object

- do pthread etc based locking using CLock from CMap, SGObject, Random