修改生产者和消费者都退出后,共享内存未删除的问题
生产者消费者注册信号处理函数,退出时检查如果没有其它进程使用共享内存,将共享内存删除
This commit is contained in:
@@ -164,8 +164,8 @@ int main(int argc, char ** args)
|
||||
{
|
||||
pthread_create(&t[i], NULL, thread_logger, (void *)(unsigned long)(i));
|
||||
}
|
||||
signal(SIGINT, sig_int_handler);
|
||||
signal(SIGHUP, sig_hup_handler);
|
||||
//signal(SIGINT, sig_int_handler);
|
||||
//signal(SIGHUP, sig_hup_handler);
|
||||
while(1)
|
||||
;
|
||||
//MESA_destroy_runtime_log_handle(sample_handle);
|
||||
|
||||
Reference in New Issue
Block a user