nicer thread lock functs