Added thread, muted and smartmutex code.