Changeset 8659a9 in git


Ignore:
Timestamp:
Apr 19, 2013, 11:11:41 AM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
e92c6adb9739e60e8b389357aa7c53b1f70172c3
Parents:
ed412c09ccb415559c285b215800716847c0b6e3
Message:
rewrite timeStd
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    red412c r8659a9  
    12041204    if ((typeof(#[1]) == "int")&&(#[1]))
    12051205    {
    1206       int wait = #[1];
    1207       int j = 10;
     1206      int wait = #[1]*1000;
    12081207
    12091208      string bs = nameof(basering);
    12101209      link l_fork = "ssi:fork";
    12111210      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
    12321219      {
    12331220        def result = read(l_fork);
     
    12391226          kill PP;
    12401227        }
    1241         close(l_fork);
    1242       }
    1243       else
    1244       {
    1245         ideal result=i;
    1246         close(l_fork);
    1247       }
     1228      }
     1229      close(l_fork);
    12481230      return (result);
    12491231    }
Note: See TracChangeset for help on using the changeset viewer.