commit - d2cbcb7722fc43af0cc1092f4572b8b9bd40fa71
commit + c73e7cf5aceda56baaa8eb8a3420ca2a8f232af5
blob - 1bc723caa6421abb755abeeb7bf6faf46686f19a
blob + 9fcd9b58196d4a672337cee8c6ed52206acbf258
--- acid/thread
+++ acid/thread
defn threads(){
local P;
-
complex Pqueue _threadpq;
+
P = (Proc)_threadpq.$head;
while P != 0 do{
if P != (Proc)_threadpq.$head then print("\n");
lproc(P);
- P = P.next;
+ P = (Proc)P.next;
}
}
defn stacks(){
local P, mainpid;
+ complex Pqueue _threadpq;
stkprefix = "";
mainpid = pid;
defn stacksizes(){
local P, T, Tq, top, sp, mainpid;
+ complex Pqueue _threadpq;
mainpid = pid;
P = (Proc)_threadpq.$head;
pthreads(P);
}
+threadstkignore = {
+ "plan9/src/libthread/",
+ "plan9/src/libc/(386|arm|alpha|sparc|power|mips)/"
+};
defn threadstks(P){
complex Proc P;
local T, Tq, mainpid, pref, ign;
pref = stkprefix;
stkprefix = pref+"\t\t";
ign = stkignore;
- stkignore = {
- "plan9/src/libthread/",
- "plan9/src/libc/(386|arm|alpha|sparc|power|mips)/"
- };
+ stkignore = threadstkignore;
setproc(P.pid);
Tq = (Tqueue)P.threads;
T = (Thread)Tq.$head;
defn procs(){
local P;
+ complex Pqueue _threadpq;
P = (Proc)_threadpq.$head;
while P != 0 do{
}
}
+defn polling() {
+ local i, c, t, p, pf;
+
+ p=(Poll)polls; pf=(struct_pollfd)pfd; loop 1,*npoll do {
+ print("\tfd ", pf.fd\D, " ");
+ if pf.events & 1 then
+ print("r");
+ else if pf.events & 2 then
+ print("w");
+ else
+ print(pf.events\D);
+ print(" chan Channel(", p.c\X, ")\n");
+ p = (Poll)(p+sizeofPoll);
+ pf = (struct_pollfd)(pf+sizeofstruct_pollfd);
+ }
+
+ c=sleepchan; t=sleeptime; loop 1,*nsleep do {
+ print("\tsleep ", *t\D, " Channel(", *c\X, ")\n");
+ c++;
+ t++;
+ }
+}
+
print(acidfile);