(From update of attachment 318923)
If this is about a race for SDR, don't we need a lock to protect the mBusy state?
What happens to the callers that will get NS_ERROR_IN_PROGRESS? Will they retry or fail?
Are multiple calls to SDR originate from multiple threads, or from event processing on a single thread?
If they originate from multiple threads, maybe we could use a condition variable, block if busy, and signal once done?
If they originated from a single thread (and spinning the event loop), it's probably more difficult to have them retry as soon as we're no longer busy.
(From update of attachment 318923)
If this is about a race for SDR, don't we need a lock to protect the mBusy state?
What happens to the callers that will get NS_ERROR_ IN_PROGRESS? Will they retry or fail?
Are multiple calls to SDR originate from multiple threads, or from event processing on a single thread?
If they originate from multiple threads, maybe we could use a condition variable, block if busy, and signal once done?
If they originated from a single thread (and spinning the event loop), it's probably more difficult to have them retry as soon as we're no longer busy.