SyncarrayList, thread

xiaoxiao2021-03-06  104

Using system; using system.collections;

Namespace synccollections {///

/// synchronized wrapper around the unsynchronized arraylist class /// public class syncarraylist {private arraylist me;

Public syncarraylist () {// // Todo: add constructor logic here // me = new arraylist ();

///

////// /// public void add (object item) {loc (me.syncroot) {me.add ( Item);}}

///

////// /// public object Object (int index) {loc (me.syncroot) {Return ME [index }}

///

/// /// /// public void addrange (iCollection C) {loc (me.syncroot) {me.addrange ( c);}}

///

/// /// /// public int Capacity () {lock (me.syncroot) {return me.capacity;}}}

///

/// /// public void clear () {loc (me.syncroot) {me.clear ();}}

///

/// /// /// /// public bool contains (Object item) {Lock (me.syncroot) {return me.contains (item);}}

///

/// /// /// public int count () {loc (me.syncroot) {return me.count;}}

///

/// /// /// /// public void insert INT INDEX, OBJECT VALUE) {Lock (me.syncroot) {me.insert (index, value);}} /// /// /// /// public void transove (object obj) {mE.REMOVE (OBJ);}}

///

////// /// public void removeat (int index) {loc (me.syncroot) {me.removeat Index);}}

///

/// /// /// /// public void removegence INT INDEX, INT Count) {mE.RemoveRange (INDEX, Count);}}}}

转载请注明原文地址:https://www.9cbs.com/read-96256.html

New Post(0)