If I have an array and want to synchronize all access to it (only one thread using it at a time), what's the best way? I know how to use 'synchronized' to make a critical section, but I want to synchronize data, not code.