c++ – Does my code fail for large input

Below is the code for mergesort using multithreading, will this code run for large number of inputs or does any other part of the code needs changing

#include<iostream>
#include<thread>
#include<mutex>
#include<vector>
#include<functional>
#include<fstream>
std::mutex mu;

void merge(std::vector<int>& vec,int s,int mid,int e){
    std::vector<int> lvec,rvec;
    for(int i=s;i<=e;i++){
        mu.lock();
        if(i<=mid)
            lvec.push_back(vec(i));
        else
            rvec.push_back(vec(i));
        mu.unlock();
    }
    int a=0,b=0,c=s;
    while(a<lvec.size()&&b<rvec.size()){
        if(lvec(a)<rvec(b)){
            vec(c++)=lvec(a++);
        }
        else
            vec(c++)=rvec(b++);
    }
        while(a<lvec.size()){
        vec(c++)=lvec(a++);
    }
    while(b<rvec.size()){
        vec(c++)=rvec(b++);
    }
}
void mergeSort(std::vector<int>& vec,int s,int e){
    if(s>=e)
        return;
    int mid=(s+e)/2;
    std::thread th1(std::bind(mergeSort,std::ref(vec),s,mid));
    std::thread th2(std::bind(mergeSort,std::ref(vec),mid+1,e));
    th1.join();
    th2.join();
    merge(vec,s,mid,e);
}

int main(){

    std::ifstream fin("input.txt");
    std::vector<int> vec;
    int data;
    while(fin >> data){
        vec.push_back(data);
    }
    mergeSort(vec,0,vec.size()-1);
//  for(int i=0;i<vec.size();i++){
//      std::cout<<vec(i)<<" ";
//  }
    std::ofstream output_file("example.txt");
    for(const auto &e:vec) output_file<<e<<" ";
}
```