Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Koch
dune-common
Commits
430b33ab
Commit
430b33ab
authored
9 years ago
by
Christoph Grüninger
Committed by
Dominic Kempf
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] To check for pthreads we need CheckForPThreads.c, too.
parent
f12ba32b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/CheckForPthreads.c
+41
-0
41 additions, 0 deletions
cmake/modules/CheckForPthreads.c
with
41 additions
and
0 deletions
cmake/modules/CheckForPthreads.c
0 → 100644
+
41
−
0
View file @
430b33ab
// file copied from CMake 3.2.1,
// remove together with FindThreadsCMake31.cmake
#include
<stdio.h>
#include
<pthread.h>
#include
<unistd.h>
void
*
runner
(
void
*
);
int
res
=
0
;
#ifdef __CLASSIC_C__
int
main
(){
int
ac
;
char
*
av
[];
#else
int
main
(
int
ac
,
char
*
av
[]){
#endif
pthread_t
tid
[
2
];
pthread_create
(
&
tid
[
0
],
0
,
runner
,
(
void
*
)
1
);
pthread_create
(
&
tid
[
1
],
0
,
runner
,
(
void
*
)
2
);
#if defined(__BEOS__) && !defined(__ZETA__) // (no usleep on BeOS 5.)
usleep
(
1
);
// for strange behavior on single-processor sun
#endif
pthread_join
(
tid
[
0
],
0
);
pthread_join
(
tid
[
1
],
0
);
if
(
ac
>
1000
){
return
*
av
[
0
];}
return
res
;
}
void
*
runner
(
void
*
args
)
{
int
cc
;
for
(
cc
=
0
;
cc
<
10
;
cc
++
)
{
printf
(
"%d CC: %d
\n
"
,
(
int
)
args
,
cc
);
}
res
++
;
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment