add hijack destination function to dummy for thread hijacking testing

This commit is contained in:
mykola2312 2024-07-23 01:58:30 +03:00
parent 0d57997a19
commit 57c74b1abb

View file

@ -49,9 +49,16 @@ __attribute__((noreturn)) void* slave3_job(void*)
} }
} }
__attribute__((noreturn)) void* hijack_destination(void*)
{
puts("thread has been redirected to this function! cool!");
while (1) sleep(1);
}
int main() int main()
{ {
status("master"); status("master");
printf("hijack_destination: %p\n", hijack_destination);
pid_t slave1 = fork(); pid_t slave1 = fork();
if (!slave1) slave1_job(); if (!slave1) slave1_job();