Lines Matching refs:object
53 reactor_t *reactor; // the reactor instance this object is registered with.
54 pthread_mutex_t lock; // protects the lifetime of this object and all variables.
86 LOG_ERROR(LOG_TAG, "%s unable to allocate object invalidation list.", __func__);
139 reactor_object_t *object =
142 object->reactor = reactor;
143 object->fd = fd;
144 object->context = context;
145 object->read_ready = read_ready;
146 object->write_ready = write_ready;
147 pthread_mutex_init(&object->lock, NULL);
155 event.data.ptr = object;
159 pthread_mutex_destroy(&object->lock);
160 osi_free(object);
164 return object;
167 bool reactor_change_registration(reactor_object_t *object,
170 assert(object != NULL);
178 event.data.ptr = object;
180 if (epoll_ctl(object->reactor->epoll_fd, EPOLL_CTL_MOD, object->fd, &event) == -1) {
181 LOG_ERROR(LOG_TAG, "%s unable to modify interest set for fd %d: %s", __func__, object->fd, strerror(errno));
185 pthread_mutex_lock(&object->lock);
186 object->read_ready = read_ready;
187 object->write_ready = write_ready;
188 pthread_mutex_unlock(&object->lock);
210 // Taking the object lock here makes sure a callback for |obj| isn't
212 // the callbacks or after. If after, we know that the object won't be
258 reactor_object_t *object = (reactor_object_t *)events[j].data.ptr;
261 if (list_contains(reactor->invalidation_list, object)) {
266 // Downgrade the list lock to an object lock.
267 pthread_mutex_lock(&object->lock);
271 if (events[j].events & (EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR) && object->read_ready)
272 object->read_ready(object->context);
273 if (!reactor->object_removed && events[j].events & EPOLLOUT && object->write_ready)
274 object->write_ready(object->context);
275 pthread_mutex_unlock(&object->lock);
278 pthread_mutex_destroy(&object->lock);
279 osi_free(object);