- WARNING0("Implement msg queue");
- /*
- if (pd->grasMsgQueueLen) {
- fprintf(stderr,"GRAS: Warning: process %d terminated, but some queued messages where not handled\n",MSG_process_self_PID());
- }
- */
-
- for (i=0; i< GRAS_MAX_CHANNEL; i++)
- if (myPID == hd->proc[i])
- hd->proc[i] = 0;
-
- for (i=0; i<hd->portLen; i++) {
- if (hd->port2chan[ i ] == pd->chan) {
- memmove(&(hd->port[i]), &(hd->port[i+1]), (hd->portLen -i -1) * sizeof(int));
- memmove(&(hd->port2chan[i]), &(hd->port2chan[i+1]), (hd->portLen -i -1) * sizeof(int));
- hd->portLen--;
- i--; /* counter the effect of the i++ at the end of the iteration */
+ if (gras_dynar_length(pd->msg_queue))
+ WARN1("process %d terminated, but some messages are still queued",
+ MSG_process_self_PID());
+
+ for (cpt=0; cpt< GRAS_MAX_CHANNEL; cpt++)
+ if (myPID == hd->proc[cpt])
+ hd->proc[cpt] = 0;
+
+ gras_dynar_foreach(hd->ports, cpt, pr) {
+ if (pr.port == pd->chan || pr.port == pd->rawChan) {
+ gras_dynar_cursor_rm(hd->ports, &cpt);