Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
c7f05e08
Commit
c7f05e08
authored
Jul 09, 2020
by
Gennadiy Rozental
Browse files
Merge pull request #2872 from elindsey:master
PiperOrigin-RevId: 320224740
parents
592d4642
a2533417
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
googletest/src/gtest-port.cc
googletest/src/gtest-port.cc
+4
-3
No files found.
googletest/src/gtest-port.cc
View file @
c7f05e08
...
...
@@ -198,7 +198,8 @@ size_t GetThreadCount() {
if
(
sysctl
(
mib
,
miblen
,
NULL
,
&
size
,
NULL
,
0
))
{
return
0
;
}
mib
[
5
]
=
size
/
mib
[
4
];
mib
[
5
]
=
static_cast
<
int
>
(
size
/
static_cast
<
size_t
>
(
mib
[
4
]));
// populate array of structs
struct
kinfo_proc
info
[
mib
[
5
]];
...
...
@@ -207,8 +208,8 @@ size_t GetThreadCount() {
}
// exclude empty members
in
t
nthreads
=
0
;
for
(
size_t
i
=
0
;
i
<
size
/
mib
[
4
];
i
++
)
{
size_
t
nthreads
=
0
;
for
(
size_t
i
=
0
;
i
<
size
/
static_cast
<
size_t
>
(
mib
[
4
]
)
;
i
++
)
{
if
(
info
[
i
].
p_tid
!=
-
1
)
nthreads
++
;
}
...
...
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