replace main std promise with a spinlock.