V 10 1 LANG:1 0 PANEL,284 171 266 221 N "_3DFace" 0 EEE E E 1 -1 -1 0 60 59 "" 0 1 EE 2 "CBRef""1" "EClose"E "" DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 LAYER, 0 1 LANG:1 6 Layer1 13 0 "PUSH_BUTTON1" "" 1 60 59 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E E E 0 0 0 0 0 0 EE E 0 1 LANG:1 0 0 1 LANG:1 62 -adobe-helvetica-medium-r-normal-*-*-100-100-100-*-*-iso8859-1 0 "" 60 59 180 86 T 1 LANG:1 9 TestAsync "main() { string semaphoreFileName=tmpnam (); int rc=system(\"/tmp/TestAsync \"+semaphoreFileName); if (rc) { DebugN(\"error in system()\",rc); return; } // now get the PID string PidFromFile; bool ok=fileToString(semaphoreFileName,PidFromFile); if (!ok) { DebugN(\"error: could not get the PID of spawned process\"); } int pid=PidFromFile; DebugN(\"PID is\",PidFromFile,pid); rc=startThread (\"guard\",pid); for (int i=1;i<=10;i++) { DebugN(\"Main thread busy doing something\",i); delay(1,0); } } void guard(int pid) { string f=\"/proc/\"+pid+\"/\"; DebugN(\"Thread: \",getThreadId(),\"We guard\",f); int max=20; for (int i=1;i<=max;i++) { int rc=access(f,R_OK); if (rc<0) { max=0; break; } DebugN(\"guard\",i,\"Access is\",rc); delay(1,0); } if (max!=0) { DebugN(\"Warning! It's taking too long!\",max); return; } DebugN(\"Child process finished - we may do for instance a dpSet here...\"); }" 0 E E E 0 LAYER, 1 1 LANG:1 6 Layer2 0 LAYER, 2 1 LANG:1 6 Layer3 0 LAYER, 3 1 LANG:1 6 Layer4 0 LAYER, 4 1 LANG:1 6 Layer5 0 LAYER, 5 1 LANG:1 6 Layer6 0 LAYER, 6 1 LANG:1 6 Layer7 0 LAYER, 7 1 LANG:1 6 Layer8 0 0