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.
Unified · Split
| @@ -201,8 +201,8 @@ wlattach(char *label) · 200 unmodified lines | |||
| 201 | 201 | ||
| 202 | wl->runing = 1; | 202 | wl->runing = 1; |
| 203 | kproc("wldispatch", dispatchproc, wl); | 203 | kproc("wldispatch", dispatchproc, wl); |
| 204 | terminit(); | ||
| 205 | qlock(&drawlock); | 204 | qlock(&drawlock); |
| 205 | terminit(); | ||
| 206 | wlflush(wl); | 206 | wlflush(wl); |
| 207 | wldrawcsd(wl); | 207 | wldrawcsd(wl); |
| 208 | qunlock(&drawlock); | 208 | qunlock(&drawlock); |
| @@ -958,7 +958,6 @@ initscreenimage(void) · 957 unmodified lines | |||
| 958 | void | 958 | void |
| 959 | deletescreenimage(void) | 959 | deletescreenimage(void) |
| 960 | { | 960 | { |
| 961 | dlock(); | ||
| 962 | if(screenimage){ | 961 | if(screenimage){ |
| 963 | /* will be freed via screendimage; disable */ | 962 | /* will be freed via screendimage; disable */ |
| 964 | screenimage->clipr = ZR; | 963 | screenimage->clipr = ZR; |
| @@ -968,15 +967,12 @@ deletescreenimage(void) · 3 unmodified lines | |||
| 968 | drawfreedimage(screendimage); | 967 | drawfreedimage(screendimage); |
| 969 | screendimage = nil; | 968 | screendimage = nil; |
| 970 | } | 969 | } |
| 971 | dunlock(); | ||
| 972 | } | 970 | } |
| 973 | 971 | ||
| 974 | void | 972 | void |
| 975 | resetscreenimage(void) | 973 | resetscreenimage(void) |
| 976 | { | 974 | { |
| 977 | dlock(); | ||
| 978 | initscreenimage(); | 975 | initscreenimage(); |
| 979 | dunlock(); | ||
| 980 | } | 976 | } |
| 981 | 977 | ||
| 982 | static Chan* | 978 | static Chan* |
| @@ -44,7 +44,6 @@ screenwin(void) · 43 unmodified lines | |||
| 44 | char *greet; | 44 | char *greet; |
| 45 | Memimage *grey; | 45 | Memimage *grey; |
| 46 | 46 | ||
| 47 | qlock(&drawlock); | ||
| 48 | back = memwhite; | 47 | back = memwhite; |
| 49 | conscol = memblack; | 48 | conscol = memblack; |
| 50 | memfillcolor(gscreen, 0x444488FF); | 49 | memfillcolor(gscreen, 0x444488FF); |
| @@ -73,7 +72,6 @@ screenwin(void) · 22 unmodified lines | |||
| 73 | curpos = window.min; | 72 | curpos = window.min; |
| 74 | window.max.y = window.min.y+((window.max.y-window.min.y)/h)*h; | 73 | window.max.y = window.min.y+((window.max.y-window.min.y)/h)*h; |
| 75 | flushmemscreen(gscreen->r); | 74 | flushmemscreen(gscreen->r); |
| 76 | qunlock(&drawlock); | ||
| 77 | 75 | ||
| 78 | termscreenputs(kmesg.buf, kmesg.n); | 76 | termscreenputs(kmesg.buf, kmesg.n); |
| 79 | } | 77 | } |
| @@ -112,11 +110,11 @@ resizeproc(void *arg) · 32 unmodified lines | |||
| 112 | continue; | 110 | continue; |
| 113 | } | 111 | } |
| 114 | gscreen->clipr = resize.r; | 112 | gscreen->clipr = resize.r; |
| 115 | qunlock(&drawlock); | ||
| 116 | 113 | ||
| 117 | screenwin(); | 114 | screenwin(); |
| 118 | deletescreenimage(); | 115 | deletescreenimage(); |
| 119 | resetscreenimage(); | 116 | resetscreenimage(); |
| 117 | qunlock(&drawlock); | ||
| 120 | osmsleep(1000); | 118 | osmsleep(1000); |
| 121 | } | 119 | } |
| 122 | } | 120 | } |