[Amizilla-cvs] amizilla/xpcom/threads plevent.c,1.2,1.3
Brought to you by:
maxlarsson
From: Jeff S. <jsh...@us...> - 2004-10-11 21:21:47
|
Update of /cvsroot/amizilla/amizilla/xpcom/threads In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3789 Modified Files: plevent.c Log Message: AmigaOS defines. Use pipes in NSPR for event notification. Index: plevent.c =================================================================== RCS file: /cvsroot/amizilla/amizilla/xpcom/threads/plevent.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** plevent.c 18 Jul 2004 00:32:50 -0000 1.2 --- plevent.c 11 Oct 2004 21:21:21 -0000 1.3 *************** *** 137,143 **** #endif ! #if defined(XP_UNIX) && !defined(XP_MACOSX) || defined (XP_AMIGAOS) #if defined(VMS) int efn; #else PRInt32 eventPipe[2]; --- 137,145 ---- #endif ! #if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined (XP_AMIGAOS) #if defined(VMS) int efn; + #elif defined(XP_AMIGAOS) + PRFileDesc *eventPipe[2]; #else PRInt32 eventPipe[2]; *************** *** 325,329 **** PR_EnterMonitor(mon); ! #if defined(XP_UNIX) && !defined(XP_MACOSX) if (self->idFunc && event) event->id = self->idFunc(self->idFuncClosure); --- 327,331 ---- PR_EnterMonitor(mon); ! #if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_AMIGAOS) if (self->idFunc && event) event->id = self->idFunc(self->idFuncClosure); *************** *** 650,654 **** self->lock = NULL; self->condVar = NULL; ! #if defined(XP_UNIX) && !defined(XP_MACOSX) self->id = 0; #endif --- 652,656 ---- self->lock = NULL; self->condVar = NULL; ! #if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined (XP_AMIGAOS) self->id = 0; #endif *************** *** 905,908 **** --- 907,916 ---- return PR_SUCCESS; + #elif defined(XP_AMIGAOS) + + self->idFunc = 0; + self->idFuncClosure = 0; + + return PR_CreatePipe(&self->eventPipe[0], &self->eventPipe[1]); #else return PR_SUCCESS; *************** *** 951,954 **** --- 959,965 ---- DisposeEventHandlerUPP(self->eventHandlerUPP); RemoveEventHandler(self->eventHandlerRef); + #elif defined(XP_AMIGAOS) + PR_Close(self->eventPipe[0]); + PR_Close(self->eventPipe[1]); #endif } *************** *** 1212,1223 **** ("_pl_NativeNotify: self=%p", self)); count = write(self->eventPipe[1], buf, 1); if (count == 1) return PR_SUCCESS; if (count == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) return PR_SUCCESS; return PR_FAILURE; }/* --- end _pl_NativeNotify() --- */ ! #endif /* defined(XP_UNIX) && !defined(XP_MACOSX) */ #if defined(XP_BEOS) --- 1223,1240 ---- ("_pl_NativeNotify: self=%p", self)); + #ifdef XP_AMIGAOS + count = PR_Write(self->eventPipe[1], buf, 1); + #else count = write(self->eventPipe[1], buf, 1); + #endif if (count == 1) return PR_SUCCESS; + #ifndef XP_AMIGAOS if (count == -1 && (errno == EAGAIN || errno == EWOULDBLOCK)) return PR_SUCCESS; + #endif return PR_FAILURE; }/* --- end _pl_NativeNotify() --- */ ! #endif /* (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_AMIGAOS) */ #if defined(XP_BEOS) *************** *** 1546,1550 **** return; } /* end _md_CreateEventQueue() */ ! #endif /* (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) */ #if defined(MAC_USE_CARBON_EVENT) --- 1563,1567 ---- return; } /* end _md_CreateEventQueue() */ ! #endif /* (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_BEOS) ||| defined(XP_AMIGAOS) */ #if defined(MAC_USE_CARBON_EVENT) *************** *** 1616,1620 **** /* extra functions for unix */ ! #if defined(XP_UNIX) && !defined(XP_MACOSX) PR_IMPLEMENT(PRInt32) --- 1633,1637 ---- /* extra functions for unix */ ! #if (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_AMIGAOS) PR_IMPLEMENT(PRInt32) *************** *** 1707,1711 **** } ! #endif /* defined(XP_UNIX) && !defined(XP_MACOSX) */ /* --- end plevent.c --- */ --- 1724,1728 ---- } ! #endif /* (defined(XP_UNIX) && !defined(XP_MACOSX)) || defined(XP_AMIGAOS) */ /* --- end plevent.c --- */ |