Creating an idle thread in VST SDK 3.7

To create another thread on the Mac I used this code so far:

    #include <Carbon/Carbon.h>
    OSStatus idleThread1(void* data)
    T2Audio *Pt = (T2Audio*)(data);

    OSStatus returnErr = MPCreateTask(idleThread1, this, 0, NULL, NULL, NULL, 0, &taskID1);
    MPSetTaskWeight(taskID1, 50);

However MPCreateTask is deprecated now and the VST3.7 SDK freaks out if you include Carbon.h.

Apple’s docs just say that it’s deprecated, but do not mention how it can be replaced. :unamused:
What is the correct way to create an idle thread with the VST3 SDK?

Thanks in advance,

Not bad, your source is 20 years in the past. See for a cross platform solution. Or if you need a macOS only solution check out the pthread API.

Yes. I am currently porting an 18 year old vst synthesizer to the VST 3.7 SDK. Back in those days C++ 11 still did not exist.