Allocate the correct number of mailboxes for the number of threads

master
Nick Krichevsky 2019-09-23 15:09:41 -04:00
parent 0b21e8be9a
commit 4cc75e59cf
1 changed files with 2 additions and 1 deletions

3
main.c
View File

@ -122,7 +122,8 @@ int main(int argc, char *argv[]) {
}
free(inputs);
int init_result = init_mailboxes(num_threads);
// Init one mailbox for each thread, and an additional one for the main thread.
int init_result = init_mailboxes(num_threads + 1);
if (init_result != 0) {
printf("Failed to setup mailboxes.\n");
return 1;