This seems a little convoluted to me. I'd suggest to add a new sleeping lock that protects the updates, then you just take the spinlock after parsing without much other changes. (The same comment also applies to patch 5).
This seems a little convoluted to me. I'd suggest to add a new sleeping lock that protects the updates, then you just take the spinlock after parsing without much other changes. (The same comment also applies to patch 5).