We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e1a1a5 commit 61573e2Copy full SHA for 61573e2
thread/thread.cpp
@@ -1024,7 +1024,8 @@ R"(
1024
RunQ rq;
1025
if (unlikely(!rq.current))
1026
LOG_ERROR_RETURN(ENOSYS, nullptr, "Photon not initialized in this vCPU (OS thread)");
1027
- size_t randomizer = (rand() % 512) * 8;
+ thread_local uint64_t random_index = 0;
1028
+ size_t randomizer = (random_index++ % 512) * 8;
1029
// stack contains struct, randomizer space, and reserved_space
1030
size_t least_stack_size = sizeof(thread) + randomizer + 63 + reserved_space;
1031
// at least a whole page for mprotect
0 commit comments