update comment in std/os/index.zig

This commit is contained in:
Andrew Kelley 2018-04-29 22:31:42 -04:00
parent 4e23fb7f06
commit 39befc35a8

View File

@ -2546,9 +2546,9 @@ pub fn spawnThread(context: var, comptime startFn: var) SpawnThreadError!&Thread
else => return unexpectedErrorPosix(usize(err)), else => return unexpectedErrorPosix(usize(err)),
} }
} else if (builtin.os == builtin.Os.linux) { } else if (builtin.os == builtin.Os.linux) {
// use linux API directly // use linux API directly. TODO use posix.CLONE_SETTLS and initialize thread local storage correctly
const flags = posix.CLONE_VM | posix.CLONE_FS | posix.CLONE_FILES | posix.CLONE_SIGHAND const flags = posix.CLONE_VM | posix.CLONE_FS | posix.CLONE_FILES | posix.CLONE_SIGHAND
| posix.CLONE_THREAD | posix.CLONE_SYSVSEM // | posix.CLONE_SETTLS | posix.CLONE_THREAD | posix.CLONE_SYSVSEM
| posix.CLONE_PARENT_SETTID | posix.CLONE_CHILD_CLEARTID | posix.CLONE_DETACHED; | posix.CLONE_PARENT_SETTID | posix.CLONE_CHILD_CLEARTID | posix.CLONE_DETACHED;
const newtls: usize = 0; const newtls: usize = 0;
const rc = posix.clone(MainFuncs.linuxThreadMain, stack_end, flags, arg, &thread_ptr.data.pid, newtls, &thread_ptr.data.pid); const rc = posix.clone(MainFuncs.linuxThreadMain, stack_end, flags, arg, &thread_ptr.data.pid, newtls, &thread_ptr.data.pid);