Bugzilla bug #17699: removed obsolete functions PR_SetThreadExit and

PR_GetThreadExit.
Modified files: pprthred.h, primpl.h, prcthr.c, prtpd.c, and pruthr.c.


git-svn-id: svn://10.0.0.236/trunk@53542 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
wtc%netscape.com
1999-11-15 21:29:29 +00:00
parent 07f823f19e
commit 251e30e5b4
5 changed files with 0 additions and 78 deletions

View File

@@ -32,20 +32,6 @@ PR_BEGIN_EXTERN_C
** THREAD PRIVATE FUNCTIONS
---------------------------------------------------------------------------*/
/*
** Add an exit func to be evaluated when the thread exits. Each thread
** can have zero or more of these.
*/
typedef void (*PRThreadExit)(void *arg);
PR_EXTERN(PRStatus) PR_SetThreadExit(PRUintn index, PRThreadExit func, void *arg);
/*
** Return the "index"'th at-exit function associated with thread
** "t". Returns NULL if the index does not reference a valid at-exit
** function.
*/
PR_EXTERN(PRThreadExit) PR_GetThreadExit(PRUintn index, void **argp);
/*
** Associate a thread object with an existing native thread.
** "type" is the type of thread object to attach

View File

@@ -564,11 +564,6 @@ extern PRUint32 _PR_CondVarToString(PRCondVar *cvar, char *buf, PRUint32 buflen)
PR_EXTERN(void) _PR_Notify(PRMonitor *mon, PRBool all, PRBool sticky);
typedef struct _PRPerThreadExit {
PRThreadExit func;
void *arg;
} _PRPerThreadExit;
/* PRThread.flags */
#define _PR_SYSTEM 0x01
#define _PR_INTERRUPT 0x02
@@ -1482,8 +1477,6 @@ struct PRThread {
* the thread from being scheduled on a
* different CPU.
*/
PRUint32 numExits;
_PRPerThreadExit *ptes;
/* thread termination condition variable for join */
PRCondVar *term;

View File

@@ -241,7 +241,6 @@ static void _PR_InitializeRecycledThread(PRThread *thread)
}
#endif
PR_ASSERT(thread->dumpArg == 0 && thread->dump == 0);
PR_ASSERT(thread->numExits == 0 && thread->ptes == 0);
PR_ASSERT(thread->errorString == 0 && thread->errorStringSize == 0);
/* Reset data members in thread structure */

View File

@@ -41,7 +41,6 @@ void _PR_CleanupThread(PRThread *thread)
{
PRUintn i;
void **ptd;
_PRPerThreadExit *pte;
PRThreadPrivateDTOR *destructor;
/* Free up per-thread-data */
@@ -59,19 +58,6 @@ void _PR_CleanupThread(PRThread *thread)
}
thread->dump = 0;
/* Invoke per-thread exit functions */
pte = &thread->ptes[0];
for (i = 0; i < thread->numExits; i++, pte++) {
if (pte->func) {
(*pte->func)(pte->arg);
pte->func = 0;
}
}
if (thread->ptes) {
PR_DELETE(thread->ptes);
thread->numExits = 0;
}
PR_ASSERT(thread->numExits == 0);
PR_DELETE(thread->errorString);
thread->errorStringSize = 0;
thread->environment = NULL;

View File

@@ -260,46 +260,4 @@ void _PR_DestroyThreadPrivate(PRThread* self)
}
} /* _PR_DestroyThreadPrivate */
#if 0
PR_IMPLEMENT(PRStatus) PR_SetThreadExit(PRUintn index, PRThreadExit func, void *arg)
{
_PRPerThreadExit *pte;
PRThread *thread = _PR_MD_CURRENT_THREAD();
if (index >= thread->numExits) {
if (thread->ptes) {
thread->ptes = (_PRPerThreadExit*)
PR_REALLOC(thread->ptes, (index+1) * sizeof(_PRPerThreadExit));
} else {
thread->ptes = (_PRPerThreadExit*)
PR_CALLOC(index+1 * sizeof(_PRPerThreadExit));
}
if (!thread->ptes) {
PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
return PR_FAILURE;
}
thread->numExits = index + 1;
}
pte = &thread->ptes[index];
pte->func = func;
pte->arg = arg;
return PR_SUCCESS;
}
PR_IMPLEMENT(PRThreadExit) PR_GetThreadExit(PRUintn index, void **argp)
{
_PRPerThreadExit *pte;
PRThread *thread = _PR_MD_CURRENT_THREAD();
if (index >= thread->numExits) {
if (argp) *argp = 0;
return 0;
}
pte = &thread->ptes[index];
if (argp) *argp = pte->arg;
return pte->func;
}
#endif
#endif /* !XP_BEOS */