Lines Matching refs:flags
83 int flags; member
100 static inline void add_poll(int h, int fd, int type, int flags,
218 int flags; member
221 int btsock_thread_add_fd(int h, int fd, int type, int flags, uint32_t user_id) { in btsock_thread_add_fd() argument
231 if (flags & SOCK_THREAD_ADD_FD_SYNC) { in btsock_thread_add_fd()
235 flags &= ~SOCK_THREAD_ADD_FD_SYNC; in btsock_thread_add_fd()
236 add_poll(h, fd, type, flags, user_id); in btsock_thread_add_fd()
242 sock_cmd_t cmd = {CMD_ADD_FD, fd, type, flags, user_id}; in btsock_thread_add_fd()
243 APPL_TRACE_DEBUG("adding fd:%d, flags:0x%x", fd, flags); in btsock_thread_add_fd()
354 static inline unsigned int flags2pevents(int flags) { in flags2pevents() argument
356 if (flags & SOCK_THREAD_FD_WR) pevents |= POLLOUT; in flags2pevents()
357 if (flags & SOCK_THREAD_FD_RD) pevents |= POLLIN; in flags2pevents()
362 static inline void set_poll(poll_slot_t* ps, int fd, int type, int flags, in set_poll() argument
371 ps->flags = flags; in set_poll()
372 ps->pfd.events = flags2pevents(flags); in set_poll()
375 static inline void add_poll(int h, int fd, int type, int flags, in add_poll() argument
386 set_poll(&ps[i], fd, type, flags | ps[i].flags, user_id); in add_poll()
393 set_poll(&ps[empty], fd, type, flags, user_id); in add_poll()
399 static inline void remove_poll(int h, poll_slot_t* ps, int flags) { in remove_poll() argument
400 if (flags == ps->flags) { in remove_poll()
407 ps->flags &= ~flags; in remove_poll()
409 ps->pfd.events = flags2pevents(ps->flags); in remove_poll()
426 add_poll(h, cmd.fd, cmd.type, cmd.flags, cmd.user_id); in process_cmd_sock()
432 remove_poll(h, poll_slot, poll_slot->flags); in process_cmd_sock()
443 ts[h].cmd_callback(fd, cmd.type, cmd.flags, cmd.user_id); in process_cmd_sock()
455 std::string flags(""); in print_events() local
456 if ((events)&POLLIN) flags += " POLLIN"; in print_events()
457 if ((events)&POLLPRI) flags += " POLLPRI"; in print_events()
458 if ((events)&POLLOUT) flags += " POLLOUT"; in print_events()
459 if ((events)&POLLERR) flags += " POLLERR"; in print_events()
460 if ((events)&POLLHUP) flags += " POLLHUP "; in print_events()
461 if ((events)&POLLNVAL) flags += " POLLNVAL"; in print_events()
462 if ((events)&POLLRDHUP) flags += " POLLRDHUP"; in print_events()
463 APPL_TRACE_DEBUG("print poll event:%x = %s", (events), flags.c_str()); in print_events()
475 int flags = 0; in process_data_sock() local
478 flags |= SOCK_THREAD_FD_RD; in process_data_sock()
481 flags |= SOCK_THREAD_FD_WR; in process_data_sock()
484 flags |= SOCK_THREAD_FD_EXCEPTION; in process_data_sock()
486 remove_poll(h, &ts[h].ps[ps_i], ts[h].ps[ps_i].flags); in process_data_sock()
487 } else if (flags) in process_data_sock()
489 flags); // remove the monitor flags that already processed in process_data_sock()
490 if (flags) ts[h].callback(pfds[i].fd, type, flags, user_id); in process_data_sock()