Merge change 6898

* changes:
  implement Mutex and Condition with pthread instead of calling futex directly.