Helpers

Shared implementation code for hunt.concurrency.

Members

Static functions

collectionToString
string collectionToString(Collection!T c)

An implementation of Collection.toString() suitable for classes with locks. Instead of holding a lock for the entire duration of toString(), or acquiring a lock for each call to Iterator.next(), we hold the lock only during the call to toArray() (less disruptive to other threads accessing the collection) and follows the maxim "Never call foreign code while holding a lock".

mapEntryToString
string mapEntryToString(K key, V val)

Optimized form of: key ~ "=" ~ val

toString
string toString(T[] a, size_t size, size_t charLength)

Like Arrays.toString(), but caller guarantees that size > 0, each element with index 0 <= i < size is a non-null string, and charLength is the sum of the lengths of the input Strings.

Meta