diff --git a/modules/oji/public/nsIThreadManager.h b/modules/oji/public/nsIThreadManager.h index a099224e9d6..0909d2efcf7 100644 --- a/modules/oji/public/nsIThreadManager.h +++ b/modules/oji/public/nsIThreadManager.h @@ -39,6 +39,7 @@ #define nsIThreadManager_h___ #include "nsISupports.h" +#include "nspr.h" //////////////////////////////////////////////////////////////////////////////// @@ -112,7 +113,7 @@ public: * Creates a new thread, calling the specified runnable's Run method (a la Java). */ NS_IMETHOD - CreateThread(PRUint32* threadID, nsIRunnable* runnable) = 0; + CreateThread(PRThread **thread, nsIRunnable* runnable) = 0; /** * Posts an event to specified thread, calling the runnable from that thread. @@ -121,7 +122,7 @@ public: * @param async if true, won't block current thread waiting for result */ NS_IMETHOD - PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async) = 0; + PostEvent(PRThread* thread, nsIRunnable* runnable, PRBool async) = 0; }; //////////////////////////////////////////////////////////////////////////////// diff --git a/modules/oji/src/nsJVMManager.cpp b/modules/oji/src/nsJVMManager.cpp index 8bfd9fa9af6..8831bfa65f4 100644 --- a/modules/oji/src/nsJVMManager.cpp +++ b/modules/oji/src/nsJVMManager.cpp @@ -284,11 +284,11 @@ static void PR_CALLBACK thread_starter(void* arg) } NS_METHOD -nsJVMManager::CreateThread(PRUint32* outThreadID, nsIRunnable* runnable) +nsJVMManager::CreateThread(PRThread **outThread, nsIRunnable* runnable) { PRThread* thread = PR_CreateThread(PR_USER_THREAD, &thread_starter, (void*) runnable, PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); - *outThreadID = NS_PTR_TO_INT32(thread); + *outThread = thread; return (thread != NULL ? NS_OK : NS_ERROR_FAILURE); } @@ -324,7 +324,7 @@ JVMRunnableEvent::~JVMRunnableEvent() } NS_METHOD -nsJVMManager::PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async) +nsJVMManager::PostEvent(PRThread* thread, nsIRunnable* runnable, PRBool async) { nsresult rv; nsCOMPtr eventService = @@ -332,7 +332,7 @@ nsJVMManager::PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async) if (NS_FAILED(rv)) return rv; nsCOMPtr eventQueue = NULL; - rv = eventService->GetThreadEventQueue((PRThread*)threadID, getter_AddRefs(eventQueue)); + rv = eventService->GetThreadEventQueue(thread, getter_AddRefs(eventQueue)); if (NS_FAILED(rv)) return rv; JVMRunnableEvent* runnableEvent = new JVMRunnableEvent(runnable); diff --git a/modules/oji/src/nsJVMManager.h b/modules/oji/src/nsJVMManager.h index 091b2a5cce9..443a502d0b4 100644 --- a/modules/oji/src/nsJVMManager.h +++ b/modules/oji/src/nsJVMManager.h @@ -121,7 +121,7 @@ public: * Creates a new thread, calling the specified runnable's Run method (a la Java). */ NS_IMETHOD - CreateThread(PRUint32* threadID, nsIRunnable* runnable); + CreateThread(PRThread **thread, nsIRunnable* runnable); /** * Posts an event to specified thread, calling the runnable from that thread. @@ -130,7 +130,7 @@ public: * @param async if true, won't block current thread waiting for result */ NS_IMETHOD - PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async); + PostEvent(PRThread *thread, nsIRunnable* runnable, PRBool async); /* from nsILiveConnectManager: */