Hi @keerthitheja,
from what you describe, the LockMode::Auto in the RingBuffer seems not to be the right way when working multithreaded.
I was not 100% sure about this but what you are facing seems to indicate exactly that.
What you can try now is to set the Lockmode to On.
Edit: 3 years ago I had a similar issue and was already asking for the Lockmode back then:
https://forum.commonvisionblox.com/t/saving-images-in-own-thread/937
So this should definately do the trick.
Cheers
Chris