Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
95be5a80
Commit
95be5a80
authored
1 year ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Simplify the child thread wait loop in cleanup()
parent
6326f6d0
No related branches found
No related tags found
No related merge requests found
Pipeline
#5796
passed
1 year ago
Stage: build
Stage: test
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/websrvr.c
+10
-8
10 additions, 8 deletions
src/sbbs3/websrvr.c
with
10 additions
and
8 deletions
src/sbbs3/websrvr.c
+
10
−
8
View file @
95be5a80
...
...
@@ -6896,15 +6896,17 @@ void web_terminate(void)
static
void
cleanup
(
int
code
)
{
if
(
protected_uint32_value
(
thread_count
)
>
1
)
{
lprintf
(
LOG_INFO
,
"0000 Waiting for %d child threads to terminate"
,
protected_uint32_value
(
thread_count
)
-
1
)
;
while
(
protected_uint32_value
(
thread_count
)
>
1
)
{
mswait
(
1000
);
listSemPost
(
&
log_list
);
lprintf
(
LOG_INFO
,
"0000 Waiting for %d child threads to terminate"
,
protected_uint32_value
(
thread_count
)
-
1
);
}
l
printf
(
LOG_INFO
,
"0000 Done waiting"
);
bool
waited
=
false
;
uint32_t
threads
;
while
((
threads
=
protected_uint32_value
(
thread_count
))
>
1
)
{
lprintf
(
LOG_INFO
,
"0000 Waiting for %d child threads to terminate"
,
threads
-
1
);
mswait
(
1000
);
waited
=
true
;
l
istSemPost
(
&
log_list
);
}
if
(
waited
)
lprintf
(
LOG_INFO
,
"0000 Done waiting"
);
terminate_js
=
false
;
free_cfg
(
&
scfg
);
...
...
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