VirtualBox

Changeset 101901 in vbox


Ignore:
Timestamp:
Nov 6, 2023 8:28:48 PM (17 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
159997
Message:

libs/xpcom: Remove more unused code in nsprpub, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/pprthred.h

    r101899 r101901  
    5353
    5454#ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
    55 #define PR_DetachThread VBoxNsprPR_DetachThread
    56 #define PR_GetThreadID VBoxNsprPR_GetThreadID
    57 #define PR_SetThreadDumpProc VBoxNsprPR_SetThreadDumpProc
    58 #define PR_GetThreadAffinityMask VBoxNsprPR_GetThreadAffinityMask
    59 #define PR_SetThreadAffinityMask VBoxNsprPR_SetThreadAffinityMask
    60 #define PR_SetCPUAffinityMask VBoxNsprPR_SetCPUAffinityMask
    61 #define PR_ShowStatus VBoxNsprPR_ShowStatus
    62 #define PR_ThreadScanStackPointers VBoxNsprPR_ThreadScanStackPointers
    63 #define PR_ScanStackPointers VBoxNsprPR_ScanStackPointers
    64 #define PR_GetStackSpaceLeft VBoxNsprPR_GetStackSpaceLeft
    6555#define PR_NewNamedMonitor VBoxNsprPR_NewNamedMonitor
    6656#define PR_TestAndLock VBoxNsprPR_TestAndLock
     
    7060
    7161PR_BEGIN_EXTERN_C
    72 
    73 /*---------------------------------------------------------------------------
    74 ** THREAD PRIVATE FUNCTIONS
    75 ---------------------------------------------------------------------------*/
    76 
    77 /*
    78 ** Get the id of the named thread. Each thread is assigned a unique id
    79 ** when it is created or attached.
    80 */
    81 NSPR_API(PRUint32) PR_GetThreadID(PRThread *thread);
    82 
    83 /*
    84 ** Set the procedure that is called when a thread is dumped. The procedure
    85 ** will be applied to the argument, arg, when called. Setting the procedure
    86 ** to NULL effectively removes it.
    87 */
    88 typedef void (*PRThreadDumpProc)(PRFileDesc *fd, PRThread *t, void *arg);
    89 NSPR_API(void) PR_SetThreadDumpProc(
    90     PRThread* thread, PRThreadDumpProc dump, void *arg);
    91 
    92 /*
    93 ** Get this thread's affinity mask.  The affinity mask is a 32 bit quantity
    94 ** marking a bit for each processor this process is allowed to run on.
    95 ** The processor mask is returned in the mask argument.
    96 ** The least-significant-bit represents processor 0.
    97 **
    98 ** Returns 0 on success, -1 on failure.
    99 */
    100 NSPR_API(PRInt32) PR_GetThreadAffinityMask(PRThread *thread, PRUint32 *mask);
    101 
    102 /*
    103 ** Set this thread's affinity mask. 
    104 **
    105 ** Returns 0 on success, -1 on failure.
    106 */
    107 NSPR_API(PRInt32) PR_SetThreadAffinityMask(PRThread *thread, PRUint32 mask );
    108 
    109 /*
    110 ** Set the default CPU Affinity mask.
    111 **
    112 */
    113 NSPR_API(PRInt32) PR_SetCPUAffinityMask(PRUint32 mask);
    114 
    11562
    11663/*---------------------------------------------------------------------------
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101874 r101901  
    394394/************************************************************************/
    395395
    396 /* XXX this needs to be exported (sigh) */
    397 struct PRThreadStack {
    398     PRCList links;
    399     PRUintn flags;
    400 
    401     char *allocBase;            /* base of stack's allocated memory */
    402     PRUint32 allocSize;         /* size of stack's allocated memory */
    403     char *stackBottom;          /* bottom of stack from C's point of view */
    404     char *stackTop;             /* top of stack from C's point of view */
    405     PRUint32 stackSize;         /* size of usable portion of the stack */
    406 
    407     PRSegment *seg;
    408         PRThread* thr;          /* back pointer to thread owning this stack */
    409 };
    410 
    411396extern void _PR_DestroyThreadPrivate(PRThread*);
    412397
     
    420405    _PRStartFn startFunc;           /* the root of the client's thread */
    421406
    422     PRThreadStack *stack;           /* info about thread's stack (for GC) */
    423407    void *environment;              /* pointer to execution environment */
    424 
    425     PRThreadDumpProc dump;          /* dump thread info out */
    426     void *dumpArg;                  /* argument for the dump function */
    427408
    428409    /*
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptthread.c

    r101900 r101901  
    8888#endif
    8989
    90 /*
    91 ** Initialize a stack for a native pthread thread
    92 */
    93 static void _PR_InitializeStack(PRThreadStack *ts)
    94 {
    95     if( ts && (ts->stackTop == 0) ) {
    96         ts->allocBase = (char *) &ts;
    97         ts->allocSize = ts->stackSize;
    98 
    99         /*
    100         ** Setup stackTop and stackBottom values.
    101         */
    102 #ifdef HAVE_STACK_GROWING_UP
    103         ts->stackBottom = ts->allocBase + ts->stackSize;
    104         ts->stackTop = ts->allocBase;
    105 #else
    106         ts->stackTop    = ts->allocBase;
    107         ts->stackBottom = ts->allocBase - ts->stackSize;
    108 #endif
    109     }
    110 }
    111 
    11290static void *_pt_root(void *arg)
    11391{
     
    126104     */
    127105    thred->id = pthread_self();
    128 
    129     /* Set up the thread stack information */
    130     _PR_InitializeStack(thred->stack);
    131106
    132107    /*
     
    303278
    304279        thred->suspend =(isGCAble) ? PT_THREAD_SETGCABLE : 0;
    305 
    306         thred->stack = PR_NEWZAP(PRThreadStack);
    307         if (thred->stack == NULL) {
    308             PRIntn oserr = errno;
    309             PR_Free(thred);  /* all that work ... poof! */
    310             PR_SetError(PR_OUT_OF_MEMORY_ERROR, oserr);
    311             thred = NULL;  /* and for what? */
    312             goto done;
    313         }
    314         thred->stack->stackSize = stackSize;
    315         thred->stack->thr = thred;
    316280
    317281#ifdef PT_NO_SIGTIMEDWAIT
     
    349313            PR_Unlock(pt_book.ml);
    350314
    351             PR_Free(thred->stack);
    352315            PR_Free(thred);  /* all that work ... poof! */
    353316            PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, oserr);
     
    595558    if (NULL != thred->errorString)
    596559        PR_Free(thred->errorString);
    597     PR_Free(thred->stack);
    598560    if (NULL != thred->syspoll_list)
    599561        PR_Free(thred->syspoll_list);
     
    660622    thred->next = thred->prev = NULL;
    661623    pt_book.first = pt_book.last = thred;
    662 
    663     thred->stack = PR_NEWZAP(PRThreadStack);
    664     PR_ASSERT(thred->stack != NULL);
    665     thred->stack->stackSize = 0;
    666     thred->stack->thr = thred;
    667         _PR_InitializeStack(thred->stack);
    668624
    669625    /*
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette