protected static function get_possible_locks_for_stores($plugindir, $plugin) {
        global $CFG; // Needed for includes.
        $supportsnativelocking = false;
        if (file_exists($plugindir.'/lib.php')) {
            require_once($plugindir.'/lib.php');
            $pluginclass = 'cachestore_'.$plugin;
            if (class_exists($pluginclass)) {
                $supportsnativelocking = array_key_exists('cache_is_lockable', class_implements($pluginclass));
            }
        }

        if (!$supportsnativelocking) {
            $config = cache_config::instance();
            $locks = array();
            foreach ($config->get_locks() as $lock => $conf) {
                if (!empty($conf['default'])) {
                    $name = get_string($lock, 'cache');
                } else {
                    $name = $lock;
                }
                $locks[$lock] = $name;
            }
        } else {
            $locks = false;
        }

        return $locks;
    }