fixed memory swap for all resource types and implemented spinlocks on the package handlers