Remove __threaded variable

This commit is contained in:
Justine Tunney 2024-07-28 23:43:22 -07:00
parent 01b09bc817
commit cf1559c448
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
15 changed files with 51 additions and 71 deletions

View file

@ -113,7 +113,6 @@ static dontinline textwindows ssize_t ForkIo2(
ssize_t rc = ForkIo(h, buf, n, fn);
if (ischild) {
// prevent crashes
__threaded = false;
__tls_enabled = false;
__pid = __imp_GetCurrentProcessId();
__klog_handle = 0;
@ -268,7 +267,6 @@ textwindows void WinMainForked(void) {
ReadOrDie(reader, __bss_start, __bss_end - __bss_start);
kStartTsc = savetsc;
__tls_enabled = false;
__threaded = false;
// fixup memory manager
__maps.maps = 0;
@ -464,8 +462,6 @@ textwindows int sys_fork_nt(uint32_t dwCreationFlags) {
// the child's pending signals is initially empty
atomic_store_explicit(&__sig.pending, 0, memory_order_relaxed);
atomic_store_explicit(&tib->tib_sigpending, 0, memory_order_relaxed);
// re-enable threads
__enable_threads();
// re-apply code morphing for function tracing
if (ftrace_stackdigs) {
_weaken(__hook)(_weaken(ftrace_hook), _weaken(GetSymbolTable)());

View file

@ -236,7 +236,6 @@ static textwindows dontinstrument uint32_t __proc_worker(void *arg) {
* Lazy initializes process tracker data structures and worker.
*/
static textwindows void __proc_setup(void) {
__enable_threads();
__proc.onbirth = CreateEvent(0, 0, 0, 0); // auto reset
__proc.haszombies = CreateEvent(0, 1, 0, 0); // manual reset
__proc.thread = CreateThread(0, 65536, __proc_worker, 0,