Squeak and native threads

Zulq zulqarnain.t.alam at jpmorgan.com
Tue Jan 9 17:56:53 UTC 2007


Since almost every method contains some sort of transaction, how about simply
making all methods an implicit transaction?


J J-6 wrote:
> 
> BankAccount>>withdraw: aNumber
> 
>   balance := balance - aNumber.
> 
>   balance < 0 ifTrue: [ OverDrawn raise ].
> 
>   ^ balance
> 
> BankAccount>>deposit: aNumber
>   balance := balance + aNumber.
>   ^ balance.
> 
> BankAccount>>transfer: aNumber to: anAccount
>   ^ [
>     anAccount deposit: aNumber.
>     self withdraw: aNumber.
>   ] asAtomicBlock value.
> 

-- 
View this message in context: http://www.nabble.com/Squeak-and-native-threads-tf2930209.html#a8242863
Sent from the Squeak - Dev mailing list archive at Nabble.com.




More information about the Squeak-dev mailing list