diff options
-rw-r--r-- | lib/ds/plevent.c | 9 | ||||
-rw-r--r-- | lib/ds/plevent.h | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/lib/ds/plevent.c b/lib/ds/plevent.c index 5ac6aaf5..9456d0ca 100644 --- a/lib/ds/plevent.c +++ b/lib/ds/plevent.c @@ -796,6 +796,15 @@ PL_GetEventQueueSelectFD(PLEventQueue* self) #endif } +PR_IMPLEMENT(PRBool) +PL_IsQueueOnCurrentThread( PLEventQueue *queue ) +{ + PRThread *me = PR_GetCurrentThread(); + if ( me == queue->handlerThread ) + return PR_TRUE; + else + return PR_FALSE; +} /* end PL_IsQueueOnCurrentThread() */ #if defined(WIN16) || defined(_WIN32) /* diff --git a/lib/ds/plevent.h b/lib/ds/plevent.h index 5df53dc7..035f3827 100644 --- a/lib/ds/plevent.h +++ b/lib/ds/plevent.h @@ -384,6 +384,14 @@ PL_EventLoop(PLEventQueue* self); PR_EXTERN(PRInt32) PL_GetEventQueueSelectFD(PLEventQueue* self); +/* +** This routine will allow you to check to see if the given eventQueue in +** on the current thread. It will return PR_TRUE if so, else it will return +** PR_FALSE +*/ +PR_EXTERN(PRBool) + PL_IsQueueOnCurrentThread( PLEventQueue *queue ); + /******************************************************************************* * Event Operations ******************************************************************************/ |