Changeset 1209
- Timestamp:
- 01/26/08 08:02:34 (10 months ago)
- Files:
-
- 1.8.3/branches/devel/src/cque.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/src/cque.c
r1208 r1209 302 302 tmp->left = 0; 303 303 tmp->cause = cause; 304 tmp->flags = 0; 304 305 for (a = 0; a < 10; a++) 305 306 if (!global_eval_context.wnxt[a]) … … 420 421 tmp->semattr = NULL; 421 422 tmp->next = NULL; 423 tmp->flags = 0; 422 424 for (a = 0; a < 10; a++) { 423 425 if (!global_eval_context.wnxt[a]) … … 1017 1019 /* Now adjust it in the wait queue. Not a clever approach, but I 1018 1020 wrote it at 3 am and clever was not an option. */ 1021 found = false; 1019 1022 for (tmp = qwait, last = NULL; tmp; last = tmp, tmp = tmp->next) { 1020 1023 if (tmp == q) { … … 1023 1026 else 1024 1027 qwait = qwait->next; 1025 1026 break;1027 }1028 }1029 found = false;1030 for (tmp = qwait, last = NULL; tmp; last = tmp, tmp = tmp->next) {1031 if (tmp->left > q->left) {1032 if (last) {1033 last->next = q;1034 q->next = tmp;1035 } else {1036 q->next = qwait;1037 qwait = q;1038 }1039 1028 found = true; 1040 1029 break; 1041 1030 } 1042 1031 } 1043 if (!found) { 1044 if (last) 1045 last->next = q; 1046 else 1047 qwait = q; 1048 q->next = NULL; 1032 if (found) { 1033 found = false; 1034 for (tmp = qwait, last = NULL; tmp; last = tmp, tmp = tmp->next) { 1035 if (tmp->left > q->left) { 1036 if (last) { 1037 last->next = q; 1038 q->next = tmp; 1039 } else { 1040 q->next = qwait; 1041 qwait = q; 1042 } 1043 found = true; 1044 break; 1045 } 1046 } 1047 if (!found) { 1048 if (last) 1049 last->next = q; 1050 else 1051 qwait = q; 1052 q->next = NULL; 1053 } 1049 1054 } 1050 1055 … … 1059 1064 for (tmp = q_ptr; tmp; tmp = tmp->next) { 1060 1065 (*tot)++; 1061 if (tmp->flags & QUEUE_HALTED) 1062 continue;1063 if (!GoodObject(tmp->player))1066 if (tmp->flags & QUEUE_HALTED) 1067 (*del)++; 1068 else if (!GoodObject(tmp->player)) 1064 1069 (*del)++; 1065 1070 else if (q_all || (Owner(tmp->player) == victim)) { … … 1161 1166 notify_format(player, 1162 1167 T 1163 ("Totals: Player...%d/%d[%ddel] Object...%d/%d[%ddel] Wait...%d/%d Semaphore...%d/%d"),1164 pq, tpq, dpq, oq, toq, doq, wq, twq, sq, tsq);1168 ("Totals: Player...%d/%d[%ddel] Object...%d/%d[%ddel] Wait...%d/%d[%ddel] Semaphore...%d/%d"), 1169 pq, tpq, dpq, oq, toq, doq, wq, twq, dwq, sq, tsq); 1165 1170 } 1166 1171 }
