Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
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
Container Registry
Model registry
Operate
Environments
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
Peter Limkilde Svendsen
relibc
Commits
3a54aa77
Verified
Commit
3a54aa77
authored
1 year ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Fix thread cleanup after main exits.
parent
50c5ce2f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pthread/mod.rs
+1
-2
1 addition, 2 deletions
src/pthread/mod.rs
with
1 addition
and
2 deletions
src/pthread/mod.rs
+
1
−
2
View file @
3a54aa77
...
...
@@ -254,8 +254,6 @@ pub unsafe fn join(thread: &Pthread) -> Result<Retval, Errno> {
// pthread_t of this thread, will no longer be valid. In practice, we can thus deallocate the
// thread state.
OS_TID_TO_PTHREAD
.lock
()
.remove
(
&
thread
.os_tid
.get
()
.read
());
dealloc_thread
(
thread
);
Ok
(
retval
)
...
...
@@ -311,6 +309,7 @@ pub unsafe fn exit_current_thread(retval: Retval) -> ! {
// On the other hand, there can be at most two strong references to each thread (OS_TID_TO_PTHREAD
// and PTHREAD_SELF), so maybe Arc is unnecessary except from being memory-safe.
unsafe
fn
dealloc_thread
(
thread
:
&
Pthread
)
{
OS_TID_TO_PTHREAD
.lock
()
.remove
(
&
thread
.os_tid
.get
()
.read
());
drop
(
Box
::
from_raw
(
thread
as
*
const
Pthread
as
*
mut
Pthread
));
}
pub
const
SIGRT_RLCT_CANCEL
:
usize
=
32
;
...
...
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