mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
Merge
This commit is contained in:
commit
39b0e57fdd
5098 changed files with 176905 additions and 81175 deletions
|
@ -314,6 +314,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) {
|
|||
}
|
||||
}
|
||||
|
||||
void os::init_before_ergo() {
|
||||
// We need to initialize large page support here because ergonomics takes some
|
||||
// decisions depending on large page support and the calculated large page size.
|
||||
large_page_init();
|
||||
}
|
||||
|
||||
void os::signal_init() {
|
||||
if (!ReduceSignalUsage) {
|
||||
|
@ -454,6 +459,7 @@ void* os::native_java_library() {
|
|||
*/
|
||||
void* os::find_agent_function(AgentLibrary *agent_lib, bool check_lib,
|
||||
const char *syms[], size_t syms_len) {
|
||||
assert(agent_lib != NULL, "sanity check");
|
||||
const char *lib_name;
|
||||
void *handle = agent_lib->os_lib();
|
||||
void *entryName = NULL;
|
||||
|
@ -484,6 +490,7 @@ bool os::find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
|
|||
void *proc_handle;
|
||||
void *save_handle;
|
||||
|
||||
assert(agent_lib != NULL, "sanity check");
|
||||
if (agent_lib->name() == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
@ -493,14 +500,13 @@ bool os::find_builtin_agent(AgentLibrary *agent_lib, const char *syms[],
|
|||
// We want to look in this process' symbol table.
|
||||
agent_lib->set_os_lib(proc_handle);
|
||||
ret = find_agent_function(agent_lib, true, syms, syms_len);
|
||||
agent_lib->set_os_lib(save_handle);
|
||||
if (ret != NULL) {
|
||||
// Found an entry point like Agent_OnLoad_lib_name so we have a static agent
|
||||
agent_lib->set_os_lib(proc_handle);
|
||||
agent_lib->set_valid();
|
||||
agent_lib->set_static_lib(true);
|
||||
return true;
|
||||
}
|
||||
agent_lib->set_os_lib(save_handle);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1485,44 +1491,6 @@ bool os::is_server_class_machine() {
|
|||
return result;
|
||||
}
|
||||
|
||||
// Read file line by line, if line is longer than bsize,
|
||||
// skip rest of line.
|
||||
int os::get_line_chars(int fd, char* buf, const size_t bsize){
|
||||
size_t sz, i = 0;
|
||||
|
||||
// read until EOF, EOL or buf is full
|
||||
while ((sz = (int) read(fd, &buf[i], 1)) == 1 && i < (bsize-2) && buf[i] != '\n') {
|
||||
++i;
|
||||
}
|
||||
|
||||
if (buf[i] == '\n') {
|
||||
// EOL reached so ignore EOL character and return
|
||||
|
||||
buf[i] = 0;
|
||||
return (int) i;
|
||||
}
|
||||
|
||||
buf[i+1] = 0;
|
||||
|
||||
if (sz != 1) {
|
||||
// EOF reached. if we read chars before EOF return them and
|
||||
// return EOF on next call otherwise return EOF
|
||||
|
||||
return (i == 0) ? -1 : (int) i;
|
||||
}
|
||||
|
||||
// line is longer than size of buf, skip to EOL
|
||||
char ch;
|
||||
while (read(fd, &ch, 1) == 1 && ch != '\n') {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
// return initial part of line that fits in buf.
|
||||
// If we reached EOF, it will be returned on next call.
|
||||
|
||||
return (int) i;
|
||||
}
|
||||
|
||||
void os::SuspendedThreadTask::run() {
|
||||
assert(Threads_lock->owned_by_self() || (_thread == VMThread::vm_thread()), "must have threads lock to call this");
|
||||
internal_do_task();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue