added threadsafe buffer for transfer of data between realtime threads