mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 15:55:15 -07:00
refactored some code
This commit is contained in:
1 parent
a3b6083a79
commit
3e3ef43b56
1 file changed
+6
-1
@@ -26,6 +26,7 @@ using the shared memory get method to allocate
|
||||
- Fixed thread so it has its own array
|
||||
- BUGFIX: Shared memory was not going away because I wasnt calling shmctl I
|
||||
mistakenly tought shmdt was all I needed.
|
||||
- http://www.csl.mtu.edu/cs4411.ck/www/NOTES/process/shm/shmdt.html
|
||||
-
|
||||
*/
|
||||
|
||||
@@ -369,11 +370,15 @@ int count3s_parallel_proc()
|
||||
}
|
||||
childcnt++;
|
||||
}
|
||||
|
||||
int pid;
|
||||
while (childcnt > 0) {
|
||||
pid = wait(NULL);
|
||||
if (DEBUG)
|
||||
|
||||
if (DEBUG) {
|
||||
printf("Process 1 PID %d finished\n", pid);
|
||||
}
|
||||
|
||||
childcnt--;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user