NSMutableArray thread safe transaction
NSMutableArray is not thread safe,envn if you add lock to every API.
Supposed this:
-
- Thread #1 get the count of the mutable array.
-
- Thread #2 remove the last objct.
-
- Thread #1 access the count-1 object,then throw exception.