pthread_kill 實驗
Thread as Process
在 Linux 底下,每個 thread 在排程時都會被當作 process,也都有個 pid。所以在 kill thread 的 pid 時,會在該 thread 起 signal handler。
Code
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <sys/types.h>
thread_local int cnt =...
notes.mukyu.dev2 min read