Skip to content

Commit b2084d9

Browse files
committed
fix: clarify JavaProfiler init API behavior
1 parent 439aacd commit b2084d9

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

ddprof-lib/src/main/cpp/vmEntry.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,8 @@ bool VM::initializeRequestStackTrace() {
574574

575575
bool VM::initProfilerBridge(JavaVM *vm, bool attach,
576576
bool delegateMonitorEvents, bool wallPrecheck) {
577+
// wallPrecheck is kept for Java API compatibility; the active wall-precheck
578+
// mode is read from Arguments when a profiling session starts.
577579
(void)wallPrecheck;
578580
TEST_LOG("VM::initProfilerBridge");
579581
if (!initShared(vm)) {

ddprof-lib/src/main/java/com/datadoghq/profiler/JavaProfiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static JavaProfiler getInstance(String scratchDir) throws IOException {
9494
* @param libLocation the path to the native library to be used instead of the bundled one
9595
* @param scratchDir directory where the bundled library will be exploded before linking; ignored when 'libLocation' is {@literal null}
9696
*/
97-
public static JavaProfiler getInstance(String libLocation, String scratchDir) throws IOException {
97+
public static synchronized JavaProfiler getInstance(String libLocation, String scratchDir) throws IOException {
9898
return getInstance(libLocation, scratchDir, false, false);
9999
}
100100

0 commit comments

Comments
 (0)