| ... | ... | @@ -375,7 +375,12 @@ pub const Thread = struct { |
| 375 | 375 | if (c.pthread_attr_init(&attr) != 0) return error.SystemResources; |
| 376 | 376 | defer assert(c.pthread_attr_destroy(&attr) == 0); |
| 377 | 377 | |
| 378 | | assert(c.pthread_attr_setstack(&attr, mmap_slice.ptr, stack_end_offset) == 0); |
| 378 | // Tell pthread where the effective stack start is and its size |
| 379 | assert(c.pthread_attr_setstack( |
| 380 | &attr, |
| 381 | mmap_slice.ptr + guard_end_offset, |
| 382 | stack_end_offset - guard_end_offset, |
| 383 | ) == 0); |
| 379 | 384 | |
| 380 | 385 | const err = c.pthread_create(&thread_ptr.data.handle, &attr, MainFuncs.posixThreadMain, @intToPtr(*c_void, arg)); |
| 381 | 386 | switch (err) { |