Reintroduced lock generating component for C code
(CPP in place). Basic tests successful.