[CORE] Add read/write lock

Signed-off-by: Jean-Christophe DUBOIS <jcd@tribudubois.net>