URI: 
       tdevdraw: only one flushproc, please (OS X) - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit f50c3e956ffbeb15f3d386752805d1baf1c708df
   DIR parent bbdebeff976a1fa1b787d285dabba617a8febbf3
  HTML Author: Russ Cox <rsc@swtch.com>
       Date:   Fri,  2 Apr 2010 14:53:13 -0700
       
       devdraw: only one flushproc, please (OS X)
       
       R=rsc
       http://codereview.appspot.com/799045
       
       Diffstat:
         M src/cmd/devdraw/osx-screen-carbon.m |       6 +++++-
       
       1 file changed, 5 insertions(+), 1 deletion(-)
       ---
   DIR diff --git a/src/cmd/devdraw/osx-screen-carbon.m b/src/cmd/devdraw/osx-screen-carbon.m
       t@@ -61,6 +61,7 @@ struct {
                int kalting;                // last keystroke was Kalt
                int touched;                // last mouse event was touchCallback
                int collapsed;                // parked in dock
       +        int flushing;                // flushproc has started
                NSMutableArray* devicelist;
        } osx;
        
       t@@ -871,7 +872,10 @@ _flushmemscreen(Rectangle r)
                qlock(&osx.flushlock);
                if(osx.windowctx == nil){
                        QDBeginCGContext(GetWindowPort(osx.window), &osx.windowctx);
       -                proccreate(flushproc, nil, 256*1024);
       +                if(!osx.flushing) {
       +                        proccreate(flushproc, nil, 256*1024);
       +                        osx.flushing = 1;
       +                }
                }
                
                cgr.origin.x = r.min.x;