FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
emscripten/tests/pthread/test_pthread_spawns.cpp at incoming · JavaScriptIOT/emscripten · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
JavaScriptIOT
/
emscripten
Public
forked from
emscripten-core/emscripten
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
emscripten
/
tests
/
pthread
/
test_pthread_spawns.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (20 loc) · 463 Bytes
Breadcrumbs
emscripten
/
tests
/
pthread
/
test_pthread_spawns.cpp
Copy path
File metadata and controls
24 lines (20 loc) · 463 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#
include
<
pthread.h
>
#
include
<
emscripten/threading.h
>
#
define
NUM_THREADS
2
void
*
thread_main
(
void
*arg)
{
pthread_exit
(
0
);
}
pthread_t
thread[
NUM_THREADS
];
int
main
()
{
for
(
int
x =
0
; x <
100
; ++x)
{
for
(
int
i =
0
; i <
NUM_THREADS
; ++i)
pthread_create
(&thread[i],
NULL
, thread_main,
0
);
if
(
emscripten_has_threading_support
())
for
(
int
i =
0
; i <
NUM_THREADS
; ++i)
pthread_join
(thread[i],
NULL
);
}
#
ifdef
REPORT_RESULT
REPORT_RESULT
(
0
);
#
endif
}
Back
|
FazBrowse Home
|
New Git URL