1. Use CAS instead of synchronized to set the complete state.
  2. Reduce the synchronized range added by the callback function.

Comment From: pivotal-cla

@lucky8987 Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

Comment From: pivotal-cla

@lucky8987 Thank you for signing the Contributor License Agreement!

Comment From: simonbasle

Thanks for the PR @lucky8987, this looks like a good performance improvement. That close to the release, I'll review it a bit more in depth and discuss it with other team members, but I expect this should make the cut 👍

Comment From: lucky8987

Thanks for the PR @lucky8987, this looks like a good performance improvement. That close to the release, I'll review it a bit more in depth and discuss it with other team members, but I expect this should make the cut 👍

OK,this is my first PR and I'm really looking forward to it being accepted.

Comment From: simonbasle

@lucky8987 good news, then: it's been merged 😉