Skip to content

Commit bf2ed33

Browse files
committed
Workaround JDK-8345810
1 parent a6879bb commit bf2ed33

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ public final class AgentBootstrap {
5656
private static boolean initialized = false;
5757
private static List<File> agentFiles = null;
5858

59+
static {
60+
// Workaround JDK-8345810.
61+
// On Linux, libpthread must be loaded and initialized
62+
// while in single threaded mode.
63+
try {
64+
if ("Linux".equals(System.getProperty("os.name"))) {
65+
System.loadLibrary("pthread");
66+
}
67+
} catch (Exception e) {
68+
}
69+
}
70+
5971
public static void premain(final String agentArgs, final Instrumentation inst) {
6072
agentmain(agentArgs, inst);
6173
}

0 commit comments

Comments
 (0)