a few workarounds. acidtypes seems not to get global types.
This commit is contained in:
parent
d2cbcb7722
commit
c73e7cf5ac
1 changed files with 33 additions and 6 deletions
39
acid/thread
39
acid/thread
|
|
@ -169,18 +169,19 @@ defn pthreads(P){
|
||||||
|
|
||||||
defn threads(){
|
defn threads(){
|
||||||
local P;
|
local P;
|
||||||
|
|
||||||
complex Pqueue _threadpq;
|
complex Pqueue _threadpq;
|
||||||
|
|
||||||
P = (Proc)_threadpq.$head;
|
P = (Proc)_threadpq.$head;
|
||||||
while P != 0 do{
|
while P != 0 do{
|
||||||
if P != (Proc)_threadpq.$head then print("\n");
|
if P != (Proc)_threadpq.$head then print("\n");
|
||||||
lproc(P);
|
lproc(P);
|
||||||
P = P.next;
|
P = (Proc)P.next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defn stacks(){
|
defn stacks(){
|
||||||
local P, mainpid;
|
local P, mainpid;
|
||||||
|
complex Pqueue _threadpq;
|
||||||
|
|
||||||
stkprefix = "";
|
stkprefix = "";
|
||||||
mainpid = pid;
|
mainpid = pid;
|
||||||
|
|
@ -202,6 +203,7 @@ defn stacks(){
|
||||||
|
|
||||||
defn stacksizes(){
|
defn stacksizes(){
|
||||||
local P, T, Tq, top, sp, mainpid;
|
local P, T, Tq, top, sp, mainpid;
|
||||||
|
complex Pqueue _threadpq;
|
||||||
|
|
||||||
mainpid = pid;
|
mainpid = pid;
|
||||||
P = (Proc)_threadpq.$head;
|
P = (Proc)_threadpq.$head;
|
||||||
|
|
@ -230,6 +232,10 @@ defn lproc(P){
|
||||||
pthreads(P);
|
pthreads(P);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
threadstkignore = {
|
||||||
|
"plan9/src/libthread/",
|
||||||
|
"plan9/src/libc/(386|arm|alpha|sparc|power|mips)/"
|
||||||
|
};
|
||||||
defn threadstks(P){
|
defn threadstks(P){
|
||||||
complex Proc P;
|
complex Proc P;
|
||||||
local T, Tq, mainpid, pref, ign;
|
local T, Tq, mainpid, pref, ign;
|
||||||
|
|
@ -238,10 +244,7 @@ defn threadstks(P){
|
||||||
pref = stkprefix;
|
pref = stkprefix;
|
||||||
stkprefix = pref+"\t\t";
|
stkprefix = pref+"\t\t";
|
||||||
ign = stkignore;
|
ign = stkignore;
|
||||||
stkignore = {
|
stkignore = threadstkignore;
|
||||||
"plan9/src/libthread/",
|
|
||||||
"plan9/src/libc/(386|arm|alpha|sparc|power|mips)/"
|
|
||||||
};
|
|
||||||
setproc(P.pid);
|
setproc(P.pid);
|
||||||
Tq = (Tqueue)P.threads;
|
Tq = (Tqueue)P.threads;
|
||||||
T = (Thread)Tq.$head;
|
T = (Thread)Tq.$head;
|
||||||
|
|
@ -272,6 +275,7 @@ defn proc(P){
|
||||||
|
|
||||||
defn procs(){
|
defn procs(){
|
||||||
local P;
|
local P;
|
||||||
|
complex Pqueue _threadpq;
|
||||||
|
|
||||||
P = (Proc)_threadpq.$head;
|
P = (Proc)_threadpq.$head;
|
||||||
while P != 0 do{
|
while P != 0 do{
|
||||||
|
|
@ -361,4 +365,27 @@ defn channel(C) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
print(acidfile);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue