Lines Matching refs:event

46  * event.
48 * A pipe or socket pair is created and the pollable event layer
50 * saved in the PRFilePrivate structure of the pollable event.
64 * On OpenVMS we use an event flag instead of a pipe or a socket since
65 * event flags are much more efficient on OpenVMS.
76 PRFileDesc *event;
79 ** Allocate an event flag and clear it.
89 ** Give NSPR the event flag's negative value. We do this because our
90 ** select interprets a negative fd as an event flag rather than a
93 event = PR_CreateSocketPollFd(-flag);
94 if (NULL == event) {
99 return event;
102 PR_IMPLEMENT(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event)
104 int flag = -PR_FileDesc2NativeHandle(event);
105 PR_DestroySocketPollFd(event);
110 PR_IMPLEMENT(PRStatus) PR_SetPollableEvent(PRFileDesc *event)
113 ** Just set the event flag.
116 status = sys$setef(-PR_FileDesc2NativeHandle(event));
124 PR_IMPLEMENT(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event)
127 ** Just clear the event flag.
130 status = sys$clref(-PR_FileDesc2NativeHandle(event));
242 PRFileDesc *event;
249 event = PR_CreateIOLayerStub(_pr_mac_polevt_id, &_pr_mac_polevt_methods);
250 if (NULL == event) {
255 ** Allocate an event flag and clear it.
266 event->secret = (PRFilePrivate*)pollDesc;
267 return event;
271 if (event) {
272 PR_DELETE(event->secret);
273 event->dtor(event);
278 PR_IMPLEMENT(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event)
280 return PR_Close(event);
286 PR_IMPLEMENT(PRStatus) PR_SetPollableEvent(PRFileDesc *event)
288 PRPollableDesc *pollDesc = (PRPollableDesc *)event->secret;
303 PR_IMPLEMENT(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event)
305 PRPollableDesc *pollDesc = (PRPollableDesc *)event->secret;
315 event has been set.
331 * event layer) will conflict with the definition of
415 PRFileDesc *event;
428 event = PR_CreateIOLayerStub(_pr_polevt_id, &_pr_polevt_methods);
429 if (NULL == event) {
432 event->secret = PR_NEW(PRFilePrivate);
433 if (event->secret == NULL) {
457 event->secret->writeEnd = fd[1];
458 if (PR_PushIOLayer(fd[0], PR_TOP_IO_LAYER, event) == PR_FAILURE) {
469 if (event) {
470 PR_DELETE(event->secret);
471 event->dtor(event);
478 PRFileDesc *event;
480 event = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
481 PR_ASSERT(NULL == event->higher && NULL == event->lower);
483 PR_Close(event->secret->writeEnd);
484 PR_DELETE(event->secret);
485 event->dtor(event);
489 PR_IMPLEMENT(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event)
491 return PR_Close(event);
496 PR_IMPLEMENT(PRStatus) PR_SetPollableEvent(PRFileDesc *event)
498 if (PR_Write(event->secret->writeEnd, &magicChar, 1) != 1) {
504 PR_IMPLEMENT(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event)
512 nBytes = PR_Read(event->lower, buf, sizeof(buf));
519 * Make sure people do not write to the pollable event fd