Airspan interview question

Q: How would you guard shared memory in multi-tasking environment?