пример мьютекса фкн

http://www.daniweb.com/software-development/c/threads/407645/1782297#post1782297