git.ucc.asn.au
/
matches
/
honours.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Parallel Programming - Trivial
[matches/honours.git]
/
course
/
semester2
/
pprog
/
assignment1
/
mthread
/
nbody.c
diff --git
a/course/semester2/pprog/assignment1/mthread/nbody.c
b/course/semester2/pprog/assignment1/mthread/nbody.c
index
42b97cf
..
4acf28f
100644
(file)
--- a/
course/semester2/pprog/assignment1/mthread/nbody.c
+++ b/
course/semester2/pprog/assignment1/mthread/nbody.c
@@
-87,16
+87,11
@@
void * Compute_Thread(void * arg)
// The main computation loop
while (true)
{
// The main computation loop
while (true)
{
-
- if (runstate != RUN) pthread_exit(NULL); //Check whether the thread needs to exit
-
-
-
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
QuitProgram(false);
//Check whether the program should quit due to steps being computed, or a timeout
if (ExitCondition())
{
QuitProgram(false);
- continue; // The check at the start of the next loop will stop the thread
+ pthread_exit(NULL);
}
if (options.draw_graphics == false && options.verbosity != 0
}
if (options.draw_graphics == false && options.verbosity != 0
UCC
git Repository :: git.ucc.asn.au