#TUNING by stefan
authorStefan Vogel <sv@exept.de>
Fri, 20 Mar 2020 13:01:09 +0100
changeset 5469 d78065ee4cff
parent 5468 e9da15c1a36c
child 5470 416a04cb68ba
#TUNING by stefan class: SharedCollection added: #addFirst: #addLast:
SharedCollection.st
--- a/SharedCollection.st	Wed Mar 18 10:11:21 2020 +0100
+++ b/SharedCollection.st	Fri Mar 20 13:01:09 2020 +0100
@@ -162,6 +162,28 @@
     "Modified: / 02-02-2017 / 17:01:08 / stefan"
 !
 
+addFirst:anElement
+    "add the argument, anObject to the front of the receiver.
+     Return the added element."
+
+    ^ accessLock critical:[
+        realCollection addFirst:anElement
+    ].
+
+    "Created: / 19-03-2020 / 18:28:50 / Stefan Vogel"
+!
+
+addLast:anElement
+    "add the argument, anObject to the end of the receiver.
+     Return the added element."
+
+    ^ accessLock critical:[
+        realCollection addLast:anElement
+    ].
+
+    "Created: / 19-03-2020 / 18:28:03 / Stefan Vogel"
+!
+
 at:index
     "retrieve the element at index while locked"