Bug 136729 64bit problems in CreateThread/PostEvent

r=joshua.xia+kyle.yuan, sr=brendan, patch by pkw@us.ibm.com
Changes PRUint32 to PRThread* in CreateThread/PostEvent.
This commit is contained in:
kyle.yuan%sun.com 2004-05-09 10:22:18 +00:00
Родитель fcf8a09a72
Коммит bd54f4156b
3 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -39,6 +39,7 @@
#define nsIThreadManager_h___ #define nsIThreadManager_h___
#include "nsISupports.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). * Creates a new thread, calling the specified runnable's Run method (a la Java).
*/ */
NS_IMETHOD 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. * 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 * @param async if true, won't block current thread waiting for result
*/ */
NS_IMETHOD NS_IMETHOD
PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async) = 0; PostEvent(PRThread* thread, nsIRunnable* runnable, PRBool async) = 0;
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -284,11 +284,11 @@ static void PR_CALLBACK thread_starter(void* arg)
} }
NS_METHOD 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, PRThread* thread = PR_CreateThread(PR_USER_THREAD, &thread_starter, (void*) runnable,
PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD, 0); 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); return (thread != NULL ? NS_OK : NS_ERROR_FAILURE);
} }
@ -324,7 +324,7 @@ JVMRunnableEvent::~JVMRunnableEvent()
} }
NS_METHOD NS_METHOD
nsJVMManager::PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async) nsJVMManager::PostEvent(PRThread* thread, nsIRunnable* runnable, PRBool async)
{ {
nsresult rv; nsresult rv;
nsCOMPtr<nsIEventQueueService> eventService = nsCOMPtr<nsIEventQueueService> eventService =
@ -332,7 +332,7 @@ nsJVMManager::PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async)
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEventQueue> eventQueue = NULL; nsCOMPtr<nsIEventQueue> eventQueue = NULL;
rv = eventService->GetThreadEventQueue((PRThread*)threadID, getter_AddRefs(eventQueue)); rv = eventService->GetThreadEventQueue(thread, getter_AddRefs(eventQueue));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
JVMRunnableEvent* runnableEvent = new JVMRunnableEvent(runnable); JVMRunnableEvent* runnableEvent = new JVMRunnableEvent(runnable);

Просмотреть файл

@ -121,7 +121,7 @@ public:
* Creates a new thread, calling the specified runnable's Run method (a la Java). * Creates a new thread, calling the specified runnable's Run method (a la Java).
*/ */
NS_IMETHOD NS_IMETHOD
CreateThread(PRUint32* threadID, nsIRunnable* runnable); CreateThread(PRThread **thread, nsIRunnable* runnable);
/** /**
* Posts an event to specified thread, calling the runnable from that thread. * 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 * @param async if true, won't block current thread waiting for result
*/ */
NS_IMETHOD NS_IMETHOD
PostEvent(PRUint32 threadID, nsIRunnable* runnable, PRBool async); PostEvent(PRThread *thread, nsIRunnable* runnable, PRBool async);
/* from nsILiveConnectManager: */ /* from nsILiveConnectManager: */