List.st
changeset 4793 435cf45a47eb
parent 4708 713e81a051ec
child 4815 ed3795b51878
equal deleted inserted replaced
4792:4761045dca42 4793:435cf45a47eb
   441     "Created: 14.2.1997 / 16:25:55 / cg"
   441     "Created: 14.2.1997 / 16:25:55 / cg"
   442 !
   442 !
   443 
   443 
   444 asSharedCollection
   444 asSharedCollection
   445     optionalAccessLock notNil ifTrue:[
   445     optionalAccessLock notNil ifTrue:[
   446         "I am alreay protected agains concurrent access"
   446         "I am alreay protected against concurrent access"
   447         ^ self
   447         ^ self
   448     ].
   448     ].
   449     
   449     
   450     ^ (List withAll:self)
   450     ^ (List withAll:self)
   451             beSynchronized;
   451             beSynchronized;
   452             yourself.
   452             yourself.
   453 
   453 
   454     "Created: / 01-08-2018 / 11:54:26 / Claus Gittinger"
   454     "Created: / 01-08-2018 / 11:54:26 / Claus Gittinger"
   455     "Modified (format): / 01-08-2018 / 15:07:20 / Stefan Vogel"
   455     "Modified (format): / 01-08-2018 / 15:07:20 / Stefan Vogel"
       
   456     "Modified (format): / 02-02-2019 / 19:26:04 / Claus Gittinger"
   456 ! !
   457 ! !
   457 
   458 
   458 !List methodsFor:'copying'!
   459 !List methodsFor:'copying'!
   459 
   460 
   460 skipInstvarIndexInDeepCopy:index
   461 skipInstvarIndexInDeepCopy:index
   664         ^ optionalAccessLock synchronized:aBlock.
   665         ^ optionalAccessLock synchronized:aBlock.
   665     ].
   666     ].
   666     ^ aBlock value.
   667     ^ aBlock value.
   667 
   668 
   668     "Created: / 01-08-2018 / 11:46:01 / Claus Gittinger"
   669     "Created: / 01-08-2018 / 11:46:01 / Claus Gittinger"
       
   670 !
       
   671 
       
   672 synchronized:aBlock
       
   673     "a shortcut, if the sync-sema is already present"
       
   674     
       
   675     optionalAccessLock notNil ifTrue:[
       
   676         ^ optionalAccessLock synchronized:aBlock.
       
   677     ].
       
   678     ^ super synchronized:aBlock.
       
   679 
       
   680     "Created: / 02-02-2019 / 19:23:27 / Claus Gittinger"
   669 ! !
   681 ! !
   670 
   682 
   671 !List methodsFor:'setup'!
   683 !List methodsFor:'setup'!
   672 
   684 
   673 beSynchronized
   685 beSynchronized