Fix swapping red/blue channels
memset to 0 cond and mutex members
ResourceManager is now thread safe