History

import drawlock fixes from 9front (thanks foura)

These were first found in drawterm commit 54f615f6c0090c7c0011f4121ecf54fcf1e07a6b. In which due to the locking issues a race was found that crashed the wayland backend. This turned out to be a bug in devdraw itself and was fixed in 9front commit e7d03d19100fe3180906c8ce3f2cab3ba9387fe8, in the meantime the temporary hack in drawterm was reverted. The proper solution was merged as mentioned but not propigated back to drawterm until now. This came up again as it was found in some instalations of KDE's wayland to cause crashes more reliably in resizes.

Jacob Moody committed 3 years ago

Commit 49142f51 parent 36debf43 files · +2 −8Browse files

Unified · Split

3 files
  1. gui-wl/wl-screen.c +1 −1
  2. kern/devdraw.c +0 −4
  3. kern/term.c +1 −3
gui-wl/wl-screen.c+1−1
@@ -201,8 +201,8 @@ wlattach(char *label) · 200 unmodified lines
201201
202202 wl->runing = 1;
203203 kproc("wldispatch", dispatchproc, wl);
204− terminit();
205204 qlock(&drawlock);
205+ terminit();
206206 wlflush(wl);
207207 wldrawcsd(wl);
208208 qunlock(&drawlock);
kern/devdraw.c+0−4
@@ -958,7 +958,6 @@ initscreenimage(void) · 957 unmodified lines
958958 void
959959 deletescreenimage(void)
960960 {
961− dlock();
962961 if(screenimage){
963962 /* will be freed via screendimage; disable */
964963 screenimage->clipr = ZR;
@@ -968,15 +967,12 @@ deletescreenimage(void) · 3 unmodified lines
968967 drawfreedimage(screendimage);
969968 screendimage = nil;
970969 }
971− dunlock();
972970 }
973971
974972 void
975973 resetscreenimage(void)
976974 {
977− dlock();
978975 initscreenimage();
979− dunlock();
980976 }
981977
982978 static Chan*
kern/term.c+1−3
@@ -44,7 +44,6 @@ screenwin(void) · 43 unmodified lines
4444 char *greet;
4545 Memimage *grey;
4646
47− qlock(&drawlock);
4847 back = memwhite;
4948 conscol = memblack;
5049 memfillcolor(gscreen, 0x444488FF);
@@ -73,7 +72,6 @@ screenwin(void) · 22 unmodified lines
7372 curpos = window.min;
7473 window.max.y = window.min.y+((window.max.y-window.min.y)/h)*h;
7574 flushmemscreen(gscreen->r);
76− qunlock(&drawlock);
7775
7876 termscreenputs(kmesg.buf, kmesg.n);
7977 }
@@ -112,11 +110,11 @@ resizeproc(void *arg) · 32 unmodified lines
112110 continue;
113111 }
114112 gscreen->clipr = resize.r;
115− qunlock(&drawlock);
116113
117114 screenwin();
118115 deletescreenimage();
119116 resetscreenimage();
117+ qunlock(&drawlock);
120118 osmsleep(1000);
121119 }
122120 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t