Skip to content

Commit

Permalink
Update thread.mm
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Dec 20, 2024
1 parent 0b59479 commit b41b88f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/xtd.core.native.macos/src/xtd/native/macos/thread.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
start_obj->first(start_obj->second);
delete start_obj;
return nullptr;
}, reinterpret_cast<void*>( new std::pair<std::function<void(intmax_t)>, intmax_t> {start, obj}));
}, reinterpret_cast<void*>(new auto(std::make_pair(start, obj))));
if (error != 0) return reinterpret_cast<intmax_t>(PTHREAD_FAILED);
// The POSIX standard provides no mechanism by which a thread A can suspend the execution of another thread B, without cooperation from B. The only way to implement a suspend/resume mechanism is to have B check periodically some global variable for a suspend request and then suspend itself on a condition variable, which another thread can signal later to restart B.
// POSIX does not support suspending a thread without its cooperation.
// A thread must periodically check a global variable and suspend itself on a condition variable.
id = reinterpret_cast<intmax_t>(thread);
return reinterpret_cast<intmax_t>(thread);
}
Expand Down

0 comments on commit b41b88f

Please sign in to comment.