whenSynchronized method

void whenSynchronized(
  1. ExecuteWhenSynchronized execute
)

Implementation

void whenSynchronized(ExecuteWhenSynchronized execute) {
  if (isSynchronized) {
    execute(); // Execute immediately if already synchronized.
  } else {
    executeWhenSynchronized
        .add(execute); // Otherwise, add it to the queue for later execution.
  }
}