这是我的main.c
static int l_psd_stop_f(void)
{
int res;
int fd_psd_socket;
if(pthread_mutex_lock(&l_mutex_wrc)) {
LOG_ERR("Can not lock WRC mutex");
return -1;
}
fd_psd_socket = l_s_wrc.fd_psd;
l_s_wrc.fd_psd = -1;
if(pthread_mutex_unlock(&l_mutex_wrc)) {
LOG_ERR("Can not unlock WRC mutex");
return -1;}
res = l_stop_psd_receiver_f(fd_psd_socket);
fd_psd_socket = -1;
if(res < 0) {
LOG_ERR("Can not close PSD socket %d : %s", res, strerror(errno));
return -1;
}
return 0;
}
我想调用并参考此代码,但是当我单击在 x-code ipad 模拟器上运行的按钮时,它会给我带来错误。
这是在ViewController.m
- (IBAction)disconnect:(id)sender {
[self l_psd_stop_f];}