setSemaphoreLimit method
Updates the maximum concurrency level for file operations.
If limit is unchanged, the call is ignored.
Throws ArgumentError if limit is zero or negative.
Changing the limit resets the internal semaphore.
Implementation
void setSemaphoreLimit(int limit) {
if (limit == _semaphoreLimit) return;
if (limit <= 0) throw ArgumentError('Invalid limit: $limit');
_semaphore = Semaphore(limit);
_semaphoreLimit = limit;
}