static int _scheduleUpdateRemoteUserState(int fd, scheduleIMP *s_imp) { char rcv_buf[SCHEDULE_INTERNAL_MSG_MAX_LEN] = { '\0' }; scheduleCCB *s_ccb = _scheduleCCBListHeader; if (_schedule_sys_id == 0) { pthread_mutex_lock(&_scheduleCCBListLock); while (s_ccb) { if (s_ccb->fd != fd) _scheduleSyncState(s_ccb->fd, rcv_buf); s_ccb = s_ccb->next; } pthread_mutex_unlock(&_scheduleCCBListLock); } return 0; }
static int _scheduleUpdateRemoteUserState(int fd, scheduleIMP *s_imp) { char rcv_buf[SCHEDULE_INTERNAL_MSG_MAX_LEN] = { '\0' }; scheduleCCB *s_ccb = NULL; if (_schedule_sys_id == 0) { pthread_mutex_lock(&_scheduleCCBListLock); s_ccb = _scheduleCCBListHeader; while (s_ccb) { if (s_ccb->fd != fd) _scheduleSyncState(s_ccb->fd, rcv_buf); s_ccb = s_ccb->next; } pthread_mutex_unlock(&_scheduleCCBListLock); } return 0; }
#define SCHEDULE_MAX_MONITOR_USER 256 typedef struct _scheduleVideoMonitor{ char name[ANTA_DEFAULT_SIZE]; /* */ tCCB *ccbs[SCHEDULE_MAX_MONITOR_USER]; /* */ struct _scheduleVideoMonitor *next; }tScheduleVideoMonitor;
if(pthread_mutex_init(&p_VideoMon->ccbs_lock,NULL) != 0){ free(p_VideoMon); return NULL; }
其他情况初始化:
pthread_mutex_t vScheduleVideoMonitorLock = PTHREAD_MUTEX_INITIALIZER;