Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pcc022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
이소현
pcc022
Commits
08dd7aee
Commit
08dd7aee
authored
3 years ago
by
이소현
Browse files
Options
Downloads
Patches
Plain Diff
th3:문제해결
parent
f28cbd89
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lec13/th3.c
+35
-0
35 additions, 0 deletions
lec13/th3.c
with
35 additions
and
0 deletions
lec13/th3.c
0 → 100644
+
35
−
0
View file @
08dd7aee
#include
<stdio.h>
#include
<sys/types.h>
#include
<unistd.h>
int
bbb
=
0
;
void
fn_s
()
{
static
int
a
=
0
;
printf
(
"== %d %d ==
\n
"
,
a
++
,
bbb
++
);
}
void
*
run
(
void
*
arg
)
{
printf
(
"Hello world of POSXI threads.%d
\n
"
,
(
int
)
(
0
)
);
for
(
int
i
=
0
;
i
<
100
;
i
++
)
{
sleep
(
1
);
fn_s
();
}
return
0
;
}
int
main
()
{
int
result1
;
run
((
void
*
)
0
);
sleep
(
10
);
run
((
void
*
)
0
);
printf
(
"Thread return %d at the end
\n
"
,
result1
);
}
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