Commits

Jeff Sickel  committed 164ff66

remove qlocks from routines that might be called from objc runtime

  • Participants
  • Parent commits 27ff51c
  • Tags release.r3

Comments (0)

Files changed (3)

File gui-osx-cocoa/screen.m

 	int			needimg;
 	int			deferflush;
 	NSCursor		*cursor;
-	QLock 		lk;
+	Lock 		lk;
 } win;
 
 struct
 	if(win.img == nil)
 		return;
 
-	qlock(&win.lk);
+	lock(&win.lk);
 	[win.content setHidden:YES];		/* prevent flushimg from drawing */
 	m = gscreen;
 
 	sendmouse();
 
 	[win.content setHidden:NO];			/* reenable the flush */
-	qunlock(&win.lk);
+	unlock(&win.lk);
 }
 
 static void

File kern/devdraw.c

 }
 
 void
+deletescreenimagenl(void)
+{
+	if(screenimage){
+		/* will be freed via screendimage; disable */
+		screenimage->clipr = ZR;
+		screenimage = nil;
+	}
+	if(screendimage){
+		drawfreedimage(screendimage);
+		screendimage = nil;
+	}
+}
+
+void
 resetscreenimage(void)
 {
 	dlock();
 	if(di == nil){
 		print("no memory to replace screen image\n");
 		freememimage(m);
-		dunlock();
 		return;
 	}
 	
 		}
 	}
 
-	deletescreenimage();
-	dlock();
+	deletescreenimagenl();
 	screendimage = di;
 	screenimage = screendimage->image;
 
 		}
 	}
 
-	dunlock();
 	mouseresize();
 }
 	}
 #endif
 
-	if(p && cpupid){
+	if(p && cpupid == 1){
 		drawqlock();
 		lock(&term.lk);
 		_termreplacescreenimage(m);