Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
EPOS Developers
EPOS
Commits
c936f598
Commit
c936f598
authored
May 23, 2013
by
Antônio Augusto Fröhlich
Browse files
Solving exercise about system object destruction
parent
7a2f9b44
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
5 deletions
+16
-5
src/abstraction/thread.cc
src/abstraction/thread.cc
+16
-5
No files found.
src/abstraction/thread.cc
View file @
c936f598
...
...
@@ -52,11 +52,22 @@ Thread::~Thread()
<<
",context={b="
<<
_context
<<
","
<<
*
_context
<<
"})
\n
"
;
if
(
_state
!=
FINISHING
)
_thread_count
--
;
_ready
.
remove
(
this
);
_suspended
.
remove
(
this
);
switch
(
_state
)
{
case
RUNNING
:
// Self deleted itself!
exit
(
-
1
);
break
;
case
READY
:
_ready
.
remove
(
this
);
break
;
case
SUSPENDED
:
_suspended
.
remove
(
this
);
break
;
case
WAITING
:
_waiting
->
remove
(
this
);
break
;
case
FINISHING
:
// Already called exit()
break
;
}
unlock
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment