-/* Copyright (c) 2010-2016. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
long number_of_tasks = xbt_str_parse_int(argv[1], "Invalid amount of tasks: %s");
long workers_count = xbt_str_parse_int(argv[4], "Invalid amount of workers: %s");
- int i;
- for (i = 0; i < number_of_tasks; i++) {
+ for (int i = 0; i < number_of_tasks; i++) {
msg_task_t task = NULL;
/* creating task and setting its category */
MSG_task_send(task, "master_mailbox");
}
- for (i = 0; i < workers_count; i++) {
+ for (int i = 0; i < workers_count; i++) {
msg_task_t finalize = MSG_task_create("finalize", 0, 1000, 0);
MSG_task_set_category(finalize, "finalize");
MSG_task_send(finalize, "master_mailbox");
while (1) {
MSG_task_receive(&(task), "master_mailbox");
- if (!strcmp(MSG_task_get_name(task), "finalize")) {
+ if (strcmp(MSG_task_get_name(task), "finalize") == 0) {
MSG_task_destroy(task);
break;
}