You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public void post(Object event) {
PostingThreadState postingState = currentPostingThreadState.get();
List<Object> eventQueue = postingState.eventQueue;
eventQueue.add(event);
if (!postingState.isPosting) {
postingState.isMainThread = isMainThread();
postingState.isPosting = true;
if (postingState.canceled) {
throw new EventBusException("Internal error. Abort state was not reset");
}
try {
while (!eventQueue.isEmpty()) {
postSingleEvent(eventQueue.remove(0), postingState);
}
} finally {
postingState.isPosting = false;
postingState.isMainThread = false;
}
}
}
When one thread run post method , postingState while always be false, Is there any example can show the case that postState be false? eventQueue size while never more than one, so Why eventQueue is necessary?
The text was updated successfully, but these errors were encountered:
post
method ,postingState
while always befalse
, Is there any example can show the case thatpostState
be false?eventQueue
size while never more than one, so WhyeventQueue
is necessary?The text was updated successfully, but these errors were encountered: