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