Sorts this using
The sort function
func is passed two elements of the this. It should return 0 if they are equal,
a negative value if the first element should be higher in the this or a positive value if the first element
should be lower in the this than the second element.
This function must be called while holding the this's lock.
the CompareDataFunc is used to sort this
user data passed to