Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
2f8fc37d
Commit
2f8fc37d
authored
Mar 18, 2020
by
jamesge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not register pthread_atfork in child process
parent
e3840c18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
sampler.cpp
src/bvar/detail/sampler.cpp
+8
-1
No files found.
src/bvar/detail/sampler.cpp
View file @
2f8fc37d
...
...
@@ -43,6 +43,10 @@ struct CombineSampler {
}
};
// True iff pthread_atfork was called. The callback to atfork works for child
// of child as well, no need to register in the child again.
static
bool
registered_atfork
=
false
;
// Call take_sample() of all scheduled samplers.
// This can be done with regular timer thread, but it's way too slow(global
// contention + log(N) heap manipulations). We need it to be super fast so that
...
...
@@ -88,7 +92,10 @@ private:
LOG
(
FATAL
)
<<
"Fail to create sampling_thread, "
<<
berror
(
rc
);
}
else
{
_created
=
true
;
pthread_atfork
(
NULL
,
NULL
,
child_callback_atfork
);
if
(
!
registered_atfork
)
{
registered_atfork
=
true
;
pthread_atfork
(
NULL
,
NULL
,
child_callback_atfork
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment