Lines Matching defs:event
88 ** wants an event flag. So, we don't create and use a pipe for
89 ** notification of when an event queue has something ready, instead
90 ** we use an event flag. Shouldn't be a problem if we only have
91 ** a few event queues.
122 /* If _md_PerformanceSetting <=0 then no event starvation otherwise events will be starved */
135 ** EventQueueType -- Defines notification type for an event queue
229 ** _pl_CreateEventQueue() -- Create the event queue
242 event_lm = PR_NewLogModule("event");
304 _pl_destroyEvent(PLEvent* event, void* data, PLEventQueue* queue)
306 PL_DequeueEvent(event, queue);
307 PL_DestroyEvent(event);
329 PL_PostEvent(PLEventQueue* self, PLEvent* event)
341 if (self->idFunc && event)
342 event->id = self->idFunc(self->idFuncClosure);
345 /* insert event into thread's event queue: */
346 if (event != NULL) {
347 PR_APPEND_LINK(&event->link, &self->queue);
371 PL_PostSynchronousEvent(PLEventQueue* self, PLEvent* event)
378 PR_ASSERT(event != NULL);
381 /* Handle the case where the thread requesting the event handling
383 result = event->handler(event);
388 event->lock = PR_NewLock();
389 if (!event->lock) {
392 event->condVar = PR_NewCondVar(event->lock);
393 if(!event->condVar) {
394 PR_DestroyLock(event->lock);
395 event->lock = NULL;
399 PR_Lock(event->lock);
403 event->synchronousResult = (void*)PR_TRUE;
405 PL_PostEvent(self, event);
407 /* We need temporarily to give up our event queue monitor if
410 the event. */
416 event->handled = PR_FALSE;
418 while (!event->handled) {
419 /* wait for event to be handled or destroyed */
420 PR_WaitCondVar(event->condVar, PR_INTERVAL_NO_TIMEOUT);
428 result = event->synchronousResult;
429 event->synchronousResult = NULL;
430 PR_Unlock(event->lock);
435 PL_DestroyEvent(event);
443 PLEvent* event = NULL;
463 /* then grab the event and return it: */
464 event = PR_EVENT_PTR(self->queue.next);
465 PR_REMOVE_AND_INIT_LINK(&event->link);
470 return event;
501 PLEvent* event = PR_EVENT_PTR(qp);
503 (*fun)(event, data, self);
509 _pl_DestroyEventForOwner(PLEvent* event, void* owner, PLEventQueue* queue)
512 if (event->owner == owner) {
514 ("$$$ \tdestroying event %0x for owner %0x", event, owner));
515 PL_DequeueEvent(event, queue);
517 if (event->synchronousResult == (void*)PR_TRUE) {
518 PR_Lock(event->lock);
519 event->synchronousResult = NULL;
520 event->handled = PR_TRUE;
521 PR_NotifyCondVar(event->condVar);
522 PR_Unlock(event->lock);
525 PL_DestroyEvent(event);
530 ("$$$ \tskipping event %0x for owner %0x", event, owner));
559 PLEvent* event = PR_EVENT_PTR(qp);
561 PR_ASSERT(event->owner != owner);
616 PLEvent* event = PL_GetEvent(self);
617 if (event == NULL)
620 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event"));
621 PL_HandleEvent(event);
622 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));
683 /* This event better not be on an event queue anymore. */
695 /* For asynchronous events, they're destroyed by the event-handler
711 /* This event better not be on an event queue anymore. */
747 only event in the queue, any calls to process
775 /* Switched from allowing event starvation to no event starvation so grab
794 PLEvent* event;
803 while ((event = PL_GetEvent(self)) == NULL) {
805 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ waiting for event"));
812 return event;
822 PLEvent* event = PL_WaitForEvent(self);
823 if (event == NULL) {
828 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event"));
829 PL_HandleEvent(event);
830 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));
852 ("$$$ Allocated event flag %d", self->efn));
900 PR_snprintf(portname, sizeof(portname), "event%lx",
929 ("$$$ Freeing event flag %d", self->efn));
1026 * Determine if an event is being starved (i.e the starvation limit has
1031 * ispending: PR_TRUE if the event is currently pending
1033 * the event has been held in the queue too long
1035 * the event was pending. This value is updated within
1037 * lastTime: Holds the last time the event was in the queue.
1039 * returns: PR_TRUE if the event is starved, PR_FALSE otherwise
1048 * It was pending previously and the event is still
1050 * over the limit which indicates the event was starved
1075 /* Determines if the there is a pending Mouse or input event */
1205 /* Just set the event flag */
1325 ** If this is the last entry, then clear the event flag. Also make sure
1487 /* Register the class for the event receiver window */
1502 /* Create the event receiver window */
1509 /* Set a property which can be used to retrieve the event queue
1718 /* peek at the next event */
1719 PLEvent *event;
1720 event = PR_EVENT_PTR(aSelf->queue.next);
1721 if (event == NULL)
1723 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ processing event %ld\n",
1724 event->id));
1725 if (event->id >= aID) {
1726 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ skipping event and breaking"));
1730 event = PL_GetEvent(aSelf);
1731 PL_HandleEvent(event);
1732 PR_LOG(event_lm, PR_LOG_DEBUG, ("$$$ done processing event"));