< prev index next >
src/hotspot/share/classfile/vmSymbols.cpp
Print this page
rev 52814 : 8214773: Replace use of thread unsafe strtok
Reviewed-by:
@@ -471,19 +471,20 @@
// Canonicalize DisableIntrinsic to contain only ',' as a separator.
// Note, DirectiveSet may not be created at this point yet since this code
// is called from initial stub geenration code.
char* local_list = (char*)DirectiveSet::canonicalize_disableintrinsic(DisableIntrinsic);
-
+ char* save_ptr;
bool found = false;
- char* token = strtok(local_list, ",");
+
+ char* token = strtok_r(local_list, ",", &save_ptr);
while (token != NULL) {
if (strcmp(token, vmIntrinsics::name_at(id)) == 0) {
found = true;
break;
} else {
- token = strtok(NULL, ",");
+ token = strtok_r(NULL, ",", &save_ptr);
}
}
FREE_C_HEAP_ARRAY(char, local_list);
return found;
< prev index next >