Add timeout of RW lock to avoid dead lock