Locking Firestore while batch writing

My Ionic 4 app calls a Google Cloud function (createTags(howmany)) that creates Firestore documents in batches - for instance, if you call createTags(50), it creates 50 documents using batch.set() & batch.commit().
I want it such that if user1 calls createTags(10000) and user2 calls createTag(5000), I want user2’s call to start after user1’s call completes.
How can I enforce that? Or does Firestore already lock the collection during a CRUD operation?

Thanks.