Changeset 8659a9 in git
- Timestamp:
- Apr 19, 2013, 11:11:41 AM (11 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- e92c6adb9739e60e8b389357aa7c53b1f70172c3
- Parents:
- ed412c09ccb415559c285b215800716847c0b6e3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
red412c r8659a9 1204 1204 if ((typeof(#[1]) == "int")&&(#[1])) 1205 1205 { 1206 int wait = #[1]; 1207 int j = 10; 1206 int wait = #[1]*1000; 1208 1207 1209 1208 string bs = nameof(basering); 1210 1209 link l_fork = "ssi:fork"; 1211 1210 open(l_fork); 1212 write(l_fork, quote(system("pid"))); 1213 int pid = read(l_fork); 1214 write(l_fork, quote(timeStd(eval(i)))); 1215 1216 // sleep in small intervalls for appr. one second 1217 if (wait > 0) 1218 { 1219 while(j < 1000000) 1220 { 1221 if (status(l_fork, "read", "ready", j)) {break;} 1222 j = j + j; 1223 } 1224 } 1225 j = 1; 1226 while (j < wait) 1227 { 1228 if (status(l_fork, "read", "ready", 1000000)) {break;} 1229 j = j + 1; 1230 } 1231 if (status(l_fork, "read", "ready")) 1211 write(l_fork, quote(std(eval(i)))); 1212 list L=l_fork; 1213 int j=waitfirst(L,wait); 1214 if (j==0) // timeout 1215 { 1216 ideal result=i; 1217 } 1218 else 1232 1219 { 1233 1220 def result = read(l_fork); … … 1239 1226 kill PP; 1240 1227 } 1241 close(l_fork); 1242 } 1243 else 1244 { 1245 ideal result=i; 1246 close(l_fork); 1247 } 1228 } 1229 close(l_fork); 1248 1230 return (result); 1249 1231 }
Note: See TracChangeset
for help on using the changeset viewer.