REWORK according to task

mutexes and ticket's variables are global now
Removing 2 warnings on linux,freebsd and opensolaris

warning on 115 and 119 line