kopia lustrzana https://gitlab.com/sane-project/backends
				
				
				
			Resolve minor thread safety problem.
							rodzic
							
								
									de84f51270
								
							
						
					
					
						commit
						80b7249ebf
					
				| 
						 | 
				
			
			@ -1627,7 +1627,6 @@ SetPackAddress (ASIC * chip, unsigned short wWidth, unsigned short wX,
 | 
			
		|||
  SendData (chip, ES01_CE_TG_G_CONTROL, 0);
 | 
			
		||||
  SendData (chip, ES01_CF_TG_B_CONTROL, 0x3C);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /* set pack area address */
 | 
			
		||||
  SendData (chip, ES01_16D_EXPOSURE_CYCLE1_SEGMENT1_START_ADDR_BYTE0,
 | 
			
		||||
	    BYTE0 (PACK_AREA_START_ADDRESS));
 | 
			
		||||
| 
						 | 
				
			
			@ -1649,7 +1648,6 @@ SetPackAddress (ASIC * chip, unsigned short wWidth, unsigned short wX,
 | 
			
		|||
    SendData (chip, 0x260 + i, 0);
 | 
			
		||||
  DBG (DBG_ASIC, "set invalid pixel finished\n");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  /* set pack start address */
 | 
			
		||||
  SendData (chip, ES01_19E_PACK_AREA_R_START_ADDR_BYTE0,
 | 
			
		||||
	    BYTE0 (PACK_AREA_START_ADDRESS));
 | 
			
		||||
| 
						 | 
				
			
			@ -1944,7 +1942,6 @@ Asic_TurnLamp (ASIC * chip, SANE_Bool isLampOn)
 | 
			
		|||
  return SANE_STATUS_GOOD;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
SANE_Status
 | 
			
		||||
Asic_TurnTA (ASIC * chip, SANE_Bool isTAOn)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -806,6 +806,8 @@ ReadDataFromScanner (void * param)
 | 
			
		|||
	  DBG (DBG_FUNC, "ReadDataFromScanner: wScanLinesThisBlock=%d\n",
 | 
			
		||||
	       wScanLinesThisBlock);
 | 
			
		||||
 | 
			
		||||
	  /* This call is thread-safe under the assumption that no function that
 | 
			
		||||
	     might run concurrently will cause a register bank switch. */
 | 
			
		||||
	  if (Asic_ReadImage (&st->chip, pReadImage, wScanLinesThisBlock) !=
 | 
			
		||||
	      SANE_STATUS_GOOD)
 | 
			
		||||
	    {
 | 
			
		||||
| 
						 | 
				
			
			@ -826,9 +828,8 @@ ReadDataFromScanner (void * param)
 | 
			
		|||
	      wReadImageLines = 0;
 | 
			
		||||
	    }
 | 
			
		||||
 | 
			
		||||
	  if ((st->dwScannedTotalLines - GetReadyLines (st)) >=
 | 
			
		||||
	      (wMaxScanLines - (wBufferLines + st->wScanLinesPerBlock)) &&
 | 
			
		||||
	      st->dwScannedTotalLines > GetReadyLines (st))
 | 
			
		||||
	  if (st->dwScannedTotalLines >= (GetReadyLines (st) +
 | 
			
		||||
	      (wMaxScanLines - (wBufferLines + st->wScanLinesPerBlock))))
 | 
			
		||||
	    {
 | 
			
		||||
	      isWaitImageLineDiff = SANE_TRUE;
 | 
			
		||||
	    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue