The locking logic was added to its own package as it may need to be used by other parts of the code. Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>