This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 205344
Collapse All | Expand All

(-) (+22 lines)
Lines 60-65 Link Here
60
import java.net.*;
60
import java.net.*;
61
import java.text.MessageFormat;
61
import java.text.MessageFormat;
62
import java.util.*;
62
import java.util.*;
63
import java.util.logging.Level;
64
import java.util.logging.Logger;
63
65
64
66
65
/**
67
/**
Lines 373-378 Link Here
373
    private static volatile boolean detachCommandReceived;
375
    private static volatile boolean detachCommandReceived;
374
    private static ProfilerServer profilerServer;
376
    private static ProfilerServer profilerServer;
375
    private static ProfilingSessionStatus status;
377
    private static ProfilingSessionStatus status;
378
    private static boolean activated = false;
376
    private static volatile boolean startTargetApp;
379
    private static volatile boolean startTargetApp;
377
    private static volatile boolean targetAppMainThreadComplete;
380
    private static volatile boolean targetAppMainThreadComplete;
378
    private static volatile Exception startupException;
381
    private static volatile Exception startupException;
Lines 916-921 Link Here
916
        }
919
        }
917
920
918
        status.targetAppRunning = true;
921
        status.targetAppRunning = true;
922
        setActivatedFlag();
923
    }
924
    
925
    private static synchronized void setActivatedFlag() {
926
        activated = true;
927
        ProfilerServer.class.notifyAll();
928
    }
929
    
930
    /**
931
     * Waits till the server gets activated; eg. all internals are initialised
932
     */
933
    public static synchronized void waitActivated() {
934
        while (!activated && !Thread.currentThread().isInterrupted()) {
935
            try {
936
                ProfilerServer.class.wait();
937
            } catch (InterruptedException e) {
938
                Thread.currentThread().interrupt();
939
            }
940
        }
919
    }
941
    }
920
942
921
    private static void forcedShutdown() {
943
    private static void forcedShutdown() {
(-)a/lib.profiler/src/org/netbeans/lib/profiler/server/SamplingThread.java (+2 lines)
Lines 38-43 Link Here
38
    }
38
    }
39
39
40
    public void run() {
40
    public void run() {
41
        ProfilerServer.waitActivated(); // #205344: Wait for the profiler engine to get activated; prevents appearing profiler methods on stack sample
42
        
41
        int adjustedSamplingInterval = samplingInterval;
43
        int adjustedSamplingInterval = samplingInterval;
42
        int upperBound = (samplingInterval * 5) / 4;
44
        int upperBound = (samplingInterval * 5) / 4;
43
        int lowerBound = samplingInterval / 10;
45
        int lowerBound = samplingInterval / 10;

Return to bug 205344