Fixed thread mutex problems.
Merge branch 'master' into mallocator
Texture resource manager now using allocator.