Changeset f1918b in git
- Timestamp:
- Nov 18, 2010, 4:21:59 PM (13 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- cde7084dc141670809afd29cafbd9c571bd9fc3a
- Parents:
- 4138ab2842a81ef497d1f21e1ed50c9133d45a6e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/iparith.cc
r4138ab rf1918b 207 207 208 208 /*=================== operations with 2 args.: static proc =================*/ 209 static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v) 210 { 211 lists Lforks = (lists)u->Data(); 212 int t = (int)(long)v->Data(); 213 int i = slStatusSsiL(Lforks, t*1000); 214 if ( i < 0 ) i = 0; 215 res->data = (void*)(long)i; 216 return FALSE; 217 } 218 /* returns 1 iff all forks are finished; 0 otherwise */ 219 static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v) 220 { 221 lists Lforks = (lists)u->Data(); 222 int timeout = 1000*(int)(long)v->Data(); 223 lists oneFork=(lists)omAllocBin(slists_bin); 224 oneFork->Init(1); 225 int i; 226 int t = getTimer(); 227 int ret = 1; 228 for (int j = 0; j <= Lforks->nr; j++) 229 { 230 oneFork->m[0].Copy(&Lforks->m[j]); 231 i = slStatusSsiL(oneFork, timeout); 232 if (i == 1) 233 { 234 timeout = timeout - getTimer() + t; 235 } 236 else { ret = 0; j = Lforks->nr+1; /* terminate the for loop */ } 237 omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv)); 238 } 239 omFreeBin((ADDRESS)oneFork, slists_bin); 240 res->data = (void*)(long)ret; 241 return FALSE; 242 } 209 /* must be ordered: first operations for chars (infix ops), 210 * then alphabetically */ 243 211 244 212 static BOOLEAN jjOP_IV_I(leftv res, leftv u, leftv v) … … 2340 2308 setFlag(res,FLAG_STD); v->flag=0; 2341 2309 return FALSE; 2310 } 2311 static BOOLEAN jjLOAD2(leftv res, leftv u,leftv v) 2312 { 2313 return jjLOAD(res, v,TRUE); 2342 2314 } 2343 2315 static BOOLEAN jjLOAD_E(leftv res, leftv v, leftv u) … … 3708 3680 return FALSE; 3709 3681 } 3682 static BOOLEAN jjWAIT1ST2(leftv res, leftv u, leftv v) 3683 { 3684 lists Lforks = (lists)u->Data(); 3685 int t = (int)(long)v->Data(); 3686 int i = slStatusSsiL(Lforks, t*1000); 3687 if ( i < 0 ) i = 0; 3688 res->data = (void*)(long)i; 3689 return FALSE; 3690 } 3691 static BOOLEAN jjWAITALL2(leftv res, leftv u, leftv v) 3692 { 3693 /* returns 1 iff all forks are finished; 0 otherwise */ 3694 lists Lforks = (lists)u->Data(); 3695 int timeout = 1000*(int)(long)v->Data(); 3696 lists oneFork=(lists)omAllocBin(slists_bin); 3697 oneFork->Init(1); 3698 int i; 3699 int t = getTimer(); 3700 int ret = 1; 3701 for (int j = 0; j <= Lforks->nr; j++) 3702 { 3703 oneFork->m[0].Copy(&Lforks->m[j]); 3704 i = slStatusSsiL(oneFork, timeout); 3705 if (i == 1) 3706 { 3707 timeout = timeout - getTimer() + t; 3708 } 3709 else { ret = 0; j = Lforks->nr+1; /* terminate the for loop */ } 3710 omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv)); 3711 } 3712 omFreeBin((ADDRESS)oneFork, slists_bin); 3713 res->data = (void*)(long)ret; 3714 return FALSE; 3715 } 3710 3716 static BOOLEAN jjWEDGE(leftv res, leftv u, leftv v) 3711 3717 { … … 3721 3727 3722 3728 /*=================== operations with 1 arg.: static proc =================*/ 3723 3724 BOOLEAN jjWAIT1ST1(leftv res, leftv a) 3725 { 3726 lists Lforks = (lists)a->Data(); 3727 int i = slStatusSsiL(Lforks, -1); 3728 while (i <= 0) i = slStatusSsiL(Lforks, 10000000); /* redo this all 10 seconds */ 3729 res->data = (void*)(long)i; 3730 return FALSE; 3731 } 3732 3733 BOOLEAN jjWAITALL1(leftv res, leftv a) 3734 { 3735 lists Lforks = (lists)a->Data(); 3736 lists oneFork=(lists)omAllocBin(slists_bin); 3737 oneFork->Init(1); 3738 int i; 3739 for (int j = 0; j <= Lforks->nr; j++) 3740 { 3741 oneFork->m[0].Copy(&Lforks->m[j]); 3742 i = slStatusSsiL(oneFork, -1); 3743 while (i != 1) i = slStatusSsiL(oneFork, 10000000); /* redo this all 10 seconds */ 3744 omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv)); 3745 } 3746 omFreeBin((ADDRESS)oneFork, slists_bin); 3747 return FALSE; 3748 } 3729 /* must be ordered: first operations for chars (infix ops), 3730 * then alphabetically */ 3749 3731 3750 3732 static BOOLEAN jjDUMMY(leftv res, leftv u) … … 4458 4440 } 4459 4441 return FALSE; 4442 } 4443 static BOOLEAN jjLOAD1(leftv res, leftv v) 4444 { 4445 return jjLOAD(res, v,FALSE); 4460 4446 } 4461 4447 static BOOLEAN jjLISTRING(leftv res, leftv v) … … 5089 5075 return FALSE; 5090 5076 } 5077 BOOLEAN jjWAIT1ST1(leftv res, leftv a) 5078 { 5079 lists Lforks = (lists)a->Data(); 5080 int i = slStatusSsiL(Lforks, -1); 5081 while (i <= 0) i = slStatusSsiL(Lforks, 10000000); /* redo this all 10 seconds */ 5082 res->data = (void*)(long)i; 5083 return FALSE; 5084 } 5085 5086 BOOLEAN jjWAITALL1(leftv res, leftv a) 5087 { 5088 lists Lforks = (lists)a->Data(); 5089 lists oneFork=(lists)omAllocBin(slists_bin); 5090 oneFork->Init(1); 5091 int i; 5092 for (int j = 0; j <= Lforks->nr; j++) 5093 { 5094 oneFork->m[0].Copy(&Lforks->m[j]); 5095 i = slStatusSsiL(oneFork, -1); 5096 while (i != 1) i = slStatusSsiL(oneFork, 10000000); /* redo this all 10 seconds */ 5097 omFreeSize((ADDRESS)oneFork->m,sizeof(sleftv)); 5098 } 5099 omFreeBin((ADDRESS)oneFork, slists_bin); 5100 return FALSE; 5101 } 5102 5091 5103 #ifdef HAVE_FANS 5092 5104 static BOOLEAN jjCONERAYS1(leftv res, leftv v) … … 5234 5246 }*/ 5235 5247 #endif /* HAVE_FANS */ 5236 static BOOLEAN jjLOAD1(leftv res, leftv v)5237 {5238 return jjLOAD(res, v,iiOp==LIB_CMD);5239 }5240 5248 static BOOLEAN jjLOAD(leftv res, leftv v, BOOLEAN autoexport) 5241 5249 { … … 5513 5521 } 5514 5522 /*=================== operations with 3 args.: static proc =================*/ 5523 /* must be ordered: first operations for chars (infix ops), 5524 * then alphabetically */ 5515 5525 static BOOLEAN jjBRACK_S(leftv res, leftv u, leftv v,leftv w) 5516 5526 { … … 6754 6764 6755 6765 /*=================== operations with many arg.: static proc =================*/ 6766 /* must be ordered: first operations for chars (infix ops), 6767 * then alphabetically */ 6756 6768 static BOOLEAN jjBREAK0(leftv res, leftv v) 6757 6769 { … … 7920 7932 7921 7933 /*=================== operations with 2 args. ============================*/ 7934 /* must be ordered: first operations for chars (infix ops), 7935 * then alphabetically */ 7922 7936 7923 7937 BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall) … … 8133 8147 8134 8148 /*==================== operations with 1 arg. ===============================*/ 8149 /* must be ordered: first operations for chars (infix ops), 8150 * then alphabetically */ 8135 8151 8136 8152 BOOLEAN iiExprArith1(leftv res, leftv a, int op) … … 8326 8342 8327 8343 /*=================== operations with 3 args. ============================*/ 8344 /* must be ordered: first operations for chars (infix ops), 8345 * then alphabetically */ 8328 8346 8329 8347 BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c) … … 8538 8556 } 8539 8557 /*==================== operations with many arg. ===============================*/ 8558 /* must be ordered: first operations for chars (infix ops), 8559 * then alphabetically */ 8540 8560 8541 8561 BOOLEAN jjANY2LIST(leftv res, leftv v, int cnt)
Note: See TracChangeset
for help on using the changeset viewer.