add readwrite lock

Signed-off-by: lizhenghn123 <lizhenghn@gmail.com>