ExternalStream.st
changeset 2262 4c4d810f006f
parent 2163 2fcc0e7c11f8
child 2264 ac5dfc03aa26
equal deleted inserted replaced
2261:61096f935f76 2262:4c4d810f006f
  3266     (OperatingSystem readCheck:fd) ifTrue:[^ false].
  3266     (OperatingSystem readCheck:fd) ifTrue:[^ false].
  3267 
  3267 
  3268     wasBlocked := OperatingSystem blockInterrupts.
  3268     wasBlocked := OperatingSystem blockInterrupts.
  3269     hasData := OperatingSystem readCheck:fd.
  3269     hasData := OperatingSystem readCheck:fd.
  3270     hasData ifFalse:[
  3270     hasData ifFalse:[
  3271         inputSema := Semaphore new.
  3271         inputSema := Semaphore new name:'inputSema'.
  3272         [
  3272         [
  3273             timeout notNil ifTrue:[
  3273             timeout notNil ifTrue:[
  3274                 Processor signal:inputSema afterMilliseconds:timeout 
  3274                 Processor signal:inputSema afterMilliseconds:timeout 
  3275             ].
  3275             ].
  3276             Processor signal:inputSema onInput:fd.
  3276             Processor signal:inputSema onInput:fd.
  3326     (OperatingSystem writeCheck:fd) ifTrue:[^ false].
  3326     (OperatingSystem writeCheck:fd) ifTrue:[^ false].
  3327 
  3327 
  3328     wasBlocked := OperatingSystem blockInterrupts.
  3328     wasBlocked := OperatingSystem blockInterrupts.
  3329     canWrite := OperatingSystem writeCheck:fd.
  3329     canWrite := OperatingSystem writeCheck:fd.
  3330     canWrite ifFalse:[
  3330     canWrite ifFalse:[
  3331         outputSema := Semaphore new.
  3331         outputSema := Semaphore new name:'outputSema'.
  3332         [
  3332         [
  3333             timeout notNil ifTrue:[
  3333             timeout notNil ifTrue:[
  3334                 Processor signal:outputSema afterMilliseconds:timeout
  3334                 Processor signal:outputSema afterMilliseconds:timeout
  3335             ].
  3335             ].
  3336             Processor signal:outputSema onOutput:fd.
  3336             Processor signal:outputSema onOutput:fd.
  3590 ! !
  3590 ! !
  3591 
  3591 
  3592 !ExternalStream class methodsFor:'documentation'!
  3592 !ExternalStream class methodsFor:'documentation'!
  3593 
  3593 
  3594 version
  3594 version
  3595     ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.118 1997-01-14 14:16:36 cg Exp $'
  3595     ^ '$Header: /cvs/stx/stx/libbasic/ExternalStream.st,v 1.119 1997-01-24 22:09:06 cg Exp $'
  3596 ! !
  3596 ! !
  3597 ExternalStream initialize!
  3597 ExternalStream initialize!