locks with timeout support

[test]