    When running under Mac OS X or FreeBSD, temporarily block PROF signal while a new thread is being spawned. This prevents the signal handler from being called before the new thread is fully initialized, and thus avoids crashes in GetEnv. The way this is implemented is by interposing calls to the native method Thread::start0. The PROF signal is unblocked in newly-created threads by the OnThreadStart callback.
    When running under Mac OS X or FreeBSD, temporarily block PROF signal while a new thread is being spawned. This prevents the signal handler from being called before the new thread is fully initialized, and thus avoids crashes in GetEnv. The way this is implemented is by interposing calls to the native method Thread::start0. The PROF signal is unblocked in newly-created threads by the OnThreadStart callback.

    I also found it necessary to only start profiling once the main thread has been created (as noted in the Java source for the Thread class, start and therefore start0 are not called for the main method thread).

    This commit should not introduce any functional changes for platforms other than OS X and FreeBSD.

nitsanw/honest-profiler,RichardWarburton/honest-profiler,mbarbon/honest-profiler,RichardWarburton/honest-profiler,mbarbon/honest-profiler,mbarbon/honest-profiler,nitsanw/honest-profiler,mbarbon/honest-profiler,nitsanw/honest-profiler,jvm-profiling-tools/honest-profiler,nitsanw/honest-profiler,RichardWarburton/honest-profiler,RichardWarburton/honest-profiler,mbarbon/honest-profiler,RichardWarburton/honest-profiler,jvm-profiling-tools/honest-profiler,RichardWarburton/honest-profiler,mbarbon/honest-profiler,jvm-profiling-tools/honest-profiler,nitsanw/honest-profiler,jvm-profiling-tools/honest-profiler,nitsanw/honest-profiler