Beispiel #1
0
void ClassLoaderData::packages_do(void f(PackageEntry*)) {
  if (_packages != NULL) {
    for (int i = 0; i < _packages->table_size(); i++) {
      for (PackageEntry* entry = _packages->bucket(i);
                              entry != NULL;
                              entry = entry->next()) {
        f(entry);
      }
    }
  }
}
Beispiel #2
0
void ClassLoaderData::packages_do(void f(PackageEntry*)) {
  // Lock-free access requires load_ptr_acquire
  PackageEntryTable* packages = load_ptr_acquire(&_packages);
  if (packages != NULL) {
    for (int i = 0; i < packages->table_size(); i++) {
      for (PackageEntry* entry = packages->bucket(i);
                              entry != NULL;
                              entry = entry->next()) {
        f(entry);
      }
    }
  }
}