register notification not working with thread in M1 chip , the same works for intel chip

created a separate thread for registering notification for bluetooth new device, but the notification callback is never called (sometimes does but mostly not).The same code works smoothly on intel chip.