improve lock related functions and macro.
improve lock related functions and macro.

snmsts/roswell,roswell/roswell,snmsts/roswell,snmsts/roswell,guicho271828/roswell,snmsts/roswell,roswell/roswell,roswell/roswell,roswell/roswell,guicho271828/roswell,guicho271828/roswell,guicho271828/roswell