setSemaphoreLimit static method

void setSemaphoreLimit(
  1. int limit
)

Updates the maximum number of concurrent file operations.

Re-initializes the global semaphore with the new limit. Throws an ArgumentError if limit is zero or negative.

Implementation

static void setSemaphoreLimit(int limit) {
  if (limit == _semaphoreLimit) return;
  if (limit <= 0) throw ArgumentError("Invalid limit: $limit");

  _semaphoreLimit = limit;
  _semaphore = Semaphore(limit);
}