message: Fix thread starting before pte_osThreadStart
diff: @@ -63,13 +63,15 @@ pub unsafe extern "C" fn pte_osThreadCreate(
  ppte_osThreadHandle: *mut pte_osThreadHandle,
  ) -> pte_osResult {
  // XXX error handling
  +
  + // Create a locked mutex, unlocked by pte_osThreadStart
  + let mutex = Box::into_raw(Box::new(2));
  + {
  let id = Sys::pte_clone();
  if id < 0 {
  return PTE_OS_GENERAL_FAILURE;
  }
  - let mutex = Box::into_raw(Box::new(0));
  -
  if id == 0 {
  // Wait until pte_osThreadStart
  pte_osMutexLock(mutex);
  @@ -84,6 +86,8 @@ pub unsafe extern "C" fn pte_osThreadCreate(
  pte_osMutexUnlock(&mut pid_mutexes_lock);
  *ppte_osThreadHandle = id;
  }
  + }
  +
  PTE_OS_OK
  }
  