diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-07-15 20:45:00 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-07-15 20:45:00 +0200 |
commit | e4436ec0bbb6e525addbe2f4a250c1de69247828 (patch) | |
tree | 499d050c2856a071aad216b43c9fae4f5a102f9e /sys/src | |
parent | 4f3724e6e1cdc5a43714efd56888b2cde38c497b (diff) |
page: fix deadlock with addpage (thanks BurnZeZ for the stacktraces)
addpage() should not be called with the display locked as it
calls showpage1() which sleeps when there are too many
processes active.
the bug was triggered by plumbing to trigger the addpage().
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/cmd/page.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/cmd/page.c b/sys/src/cmd/page.c index 8f0a5b5bb..534baff31 100644 --- a/sys/src/cmd/page.c +++ b/sys/src/cmd/page.c @@ -1681,7 +1681,6 @@ main(int argc, char *argv[]) ground = allocimage(display, Rect(0,0,1,1), screen->chan, 1, 0x777777FF); display->locking = 1; unlockdisplay(display); - drawlock(1); einit(Ekeyboard|Emouse); eplumb(Eplumb, "image"); @@ -1698,6 +1697,7 @@ main(int argc, char *argv[]) for(; *argv; argv++) addpage(root, *argv, popenfile, strdup(*argv), -1); + drawlock(1); for(;;){ drawlock(0); i=event(&e); @@ -1802,7 +1802,9 @@ main(int argc, char *argv[]) j = trywalk(s, plumblookup(pm->attr, "addr")); if(j == nil){ current = root; + drawlock(0); j = addpage(root, s, popenfile, s, fd); + drawlock(1); } showpage(j); } |