Lock support

Do you have any suggestions for API?