Problem with automation in Live

I would rather use a Lock Free queue rather than using any lock.
At least I think this is safer to put the lock inside the process loop.

Something like this:

void AutomationNotifier::process()
{
   for (int i = 0; i < this->numberOfMessages; i++)
   {
      this->audioProcessor->getCallbackLock().enter();
      MidiMessage message = this->midiMessageQueue[i];
      audioProcessor->postMessage(new ParameterChangedMessage(message));
      this->audioProcessor->getCallbackLock().exit();
   }

   this->numberOfMessages = 0;
}   

Thanks. I will move the lock inside the loop to keep it short as possible. Great article about lock free queues. I had a look at different ‘Single Producer / Single Consumer’ Queues and currently could not find a suitable one that works on different platforms, without c++ 11…