thread basic and lock