Added the unregister_function opreation and a mutex which protect m_observers from data races. A new testcase included