r=marklin

bug=7785
a=edburns

Change nsIThreadManager::GetCurrentThread(PRUint32 *result)
to nsIThreadManager::GetCurrentThread(nsPluginThread* *result)
This commit is contained in:
edburns%acm.org 1999-12-06 20:12:56 +00:00
parent ec0053b9d3
commit 8d3843239c
5 changed files with 14 additions and 8 deletions

View File

@ -41,6 +41,8 @@
class nsIRunnable;
typedef struct _nsPluginThread nsPluginThread;
class nsIThreadManager : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_ITHREADMANAGER_IID)
@ -49,7 +51,7 @@ public:
* Returns a unique identifier for the "current" system thread.
*/
NS_IMETHOD
GetCurrentThread(PRUint32* threadID) = 0;
GetCurrentThread(nsPluginThread* *threadID) = 0;
/**
* Pauses the current thread for the specified number of milliseconds.

View File

@ -153,9 +153,9 @@ nsJVMManager::ShowJavaConsole(void)
// nsIThreadManager:
NS_METHOD
nsJVMManager::GetCurrentThread(PRUint32* threadID)
nsJVMManager::GetCurrentThread(nsPluginThread* *threadID)
{
*threadID = PRUint32(PR_GetCurrentThread());
*threadID = (nsPluginThread *) PR_GetCurrentThread();
return NS_OK;
}

View File

@ -60,7 +60,7 @@ public:
* Returns a unique identifier for the "current" system thread.
*/
NS_IMETHOD
GetCurrentThread(PRUint32* threadID);
GetCurrentThread(nsPluginThread* *threadID);
/**
* Pauses the current thread for the specified number of milliseconds.

View File

@ -150,7 +150,7 @@ const UInt32 MRJPlugin::kInterfaceCount = sizeof(sInterfaces) / sizeof(Interface
MRJPlugin::MRJPlugin()
: SupportsMixin(this, sInterfaces, kInterfaceCount),
mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mIsEnabled(false), mPluginThreadID(0)
mManager(NULL), mThreadManager(NULL), mSession(NULL), mConsole(NULL), mIsEnabled(false), mPluginThreadID(NULL)
{
}
@ -503,10 +503,14 @@ MRJPluginInstance* MRJPlugin::getPluginInstance(JNIEnv* jenv)
Boolean MRJPlugin::inPluginThread()
{
PRUint32 currentThreadID = -1;
Boolean result = false;
nsPluginThread *currentThreadID = -1;
if (mThreadManager != NULL)
mThreadManager->GetCurrentThread(&currentThreadID);
return (mPluginThreadID == currentThreadID);
if ((NULL != currentThreadID) && (NULL != mPluginThreadID)) {
result = (*mPluginThreadID == *currentThreadID);
}
return result;
}
#pragma mark *** MRJPluginInstance ***

View File

@ -237,7 +237,7 @@ private:
nsIThreadManager* mThreadManager;
MRJSession* mSession;
MRJConsole* mConsole;
PRUint32 mPluginThreadID;
nsPluginThread *mPluginThreadID;
Boolean mIsEnabled;
// support for SupportsMixin.