Mutexes added for multi threadty

    Domain is locked when getting acces to private datas.
    The print function also have a static mutex to avoid crossed
    threads prints