VirtualBox

Changeset 101947 in vbox for trunk


Ignore:
Timestamp:
Nov 7, 2023 3:22:59 PM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160044
Message:

libs/xpcom: Get rid of now unused code in nsprpub, bugref:10545

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

Legend:

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

    r101818 r101947  
    4646#define PR_Abort VBoxNsprPR_Abort
    4747#define PR_Cleanup VBoxNsprPR_Cleanup
    48 #define PR_DisableClockInterrupts VBoxNsprPR_DisableClockInterrupts
    49 #define PR_EnableClockInterrupts VBoxNsprPR_EnableClockInterrupts
    50 #define PR_BlockClockInterrupts VBoxNsprPR_BlockClockInterrupts
    51 #define PR_UnblockClockInterrupts VBoxNsprPR_UnblockClockInterrupts
    5248#define PR_Init VBoxNsprPR_Init
    5349#define PR_Initialize VBoxNsprPR_Initialize
    5450#define PR_Initialized VBoxNsprPR_Initialized
    55 #define PR_VersionCheck VBoxNsprPR_VersionCheck
    5651#define PR_SetFDCacheSize VBoxNsprPR_SetFDCacheSize
    57 #define PR_ProcessExit VBoxNsprPR_ProcessExit
    58 #define PR_CallOnce VBoxNsprPR_CallOnce
    59 #define PR_CallOnceWithArg VBoxNsprPR_CallOnceWithArg
    6052#endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
    6153
     
    8577#define PR_VPATCH   0
    8678#define PR_BETA     PR_TRUE
    87 
    88 /*
    89 ** PRVersionCheck
    90 **
    91 ** The basic signature of the function that is called to provide version
    92 ** checking. The result will be a boolean that indicates the likelihood
    93 ** that the underling library will perform as the caller expects.
    94 **
    95 ** The only argument is a string, which should be the verson identifier
    96 ** of the library in question. That string will be compared against an
    97 ** equivalent string that represents the actual build version of the
    98 ** exporting library.
    99 **
    100 ** The result will be the logical union of the directly called library
    101 ** and all dependent libraries.
    102 */
    103 
    104 typedef PRBool (*PRVersionCheck)(const char*);
    105 
    106 /*
    107 ** PR_VersionCheck
    108 **
    109 ** NSPR's existance proof of the version check function.
    110 **
    111 ** Note that NSPR has no cooperating dependencies.
    112 */
    113 
    114 NSPR_API(PRBool) PR_VersionCheck(const char *importedVersion);
    115 
    11679
    11780/************************************************************************/
     
    175138
    176139/*
    177 ** Disable Interrupts
    178 **              Disables timer signals used for pre-emptive scheduling.
    179 */
    180 NSPR_API(void) PR_DisableClockInterrupts(void);
    181 
    182 /*
    183 ** Enables Interrupts
    184 **              Enables timer signals used for pre-emptive scheduling.
    185 */
    186 NSPR_API(void) PR_EnableClockInterrupts(void);
    187 
    188 /*
    189 ** Block Interrupts
    190 **              Blocks the timer signal used for pre-emptive scheduling
    191 */
    192 NSPR_API(void) PR_BlockClockInterrupts(void);
    193 
    194 /*
    195 ** Unblock Interrupts
    196 **              Unblocks the timer signal used for pre-emptive scheduling
    197 */
    198 NSPR_API(void) PR_UnblockClockInterrupts(void);
    199 
    200 /*
    201140** Control the method and size of the file descriptor (PRFileDesc*)
    202141** cache used by the runtime. Setting 'high' to zero is for performance,
     
    204143*/
    205144NSPR_API(PRStatus) PR_SetFDCacheSize(PRIntn low, PRIntn high);
    206 
    207 /*
    208  * Cause an immediate, nongraceful, forced termination of the process.
    209  * It takes a PRIntn argument, which is the exit status code of the
    210  * process.
    211  */
    212 NSPR_API(void) PR_ProcessExit(PRIntn status);
    213145
    214146/*
     
    219151NSPR_API(void) PR_Abort(void);
    220152
    221 /*
    222  ****************************************************************
    223  *
    224  * Module initialization:
    225  *
    226  ****************************************************************
    227  */
    228 
    229 typedef struct PRCallOnceType {
    230     PRIntn initialized;
    231     PRInt32 inProgress;
    232     PRStatus status;
    233 } PRCallOnceType;
    234 
    235 typedef PRStatus (PR_CALLBACK *PRCallOnceFN)(void);
    236 
    237 typedef PRStatus (PR_CALLBACK *PRCallOnceWithArgFN)(void *arg);
    238 
    239 NSPR_API(PRStatus) PR_CallOnce(
    240     PRCallOnceType *once,
    241     PRCallOnceFN    func
    242 );
    243 
    244 NSPR_API(PRStatus) PR_CallOnceWithArg(
    245     PRCallOnceType      *once,
    246     PRCallOnceWithArgFN  func,
    247     void                *arg
    248 );
    249 
    250 
    251153PR_END_EXTERN_C
    252154
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101945 r101947  
    516516extern void _PR_NotifyCondVar(PRCondVar *cvar, PRThread *me);
    517517extern void _PR_CleanupThread(PRThread *thread);
    518 extern void _PR_CleanupCallOnce(void);
    519518extern void _PR_CleanupMW(void);
    520519extern void _PR_CleanupDtoa(void);
     
    535534extern PRBool _pr_initialized;
    536535extern void _PR_ImplicitInitialization(void);
    537 extern PRBool _PR_Obsolete(const char *obsolete, const char *preferred);
    538536
    539537/************************************************************************/
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c

    r101945 r101947  
    6868PRLock *_pr_sleeplock;  /* used in PR_Sleep(), classic and pthreads */
    6969
    70 static void _PR_InitCallOnce(void);
    71 
    7270PRBool _pr_initialized = PR_FALSE;
    73 
    74 
    75 PR_IMPLEMENT(PRBool) PR_VersionCheck(const char *importedVersion)
    76 {
    77     /*
    78     ** This is the secret handshake algorithm.
    79     **
    80     ** This release has a simple version compatibility
    81     ** check algorithm.  This release is not backward
    82     ** compatible with previous major releases.  It is
    83     ** not compatible with future major, minor, or
    84     ** patch releases.
    85     */
    86     int vmajor = 0, vminor = 0, vpatch = 0;
    87     const char *ptr = importedVersion;
    88 
    89     while (isdigit(*ptr)) {
    90         vmajor = 10 * vmajor + *ptr - '0';
    91         ptr++;
    92     }
    93     if (*ptr == '.') {
    94         ptr++;
    95         while (isdigit(*ptr)) {
    96             vminor = 10 * vminor + *ptr - '0';
    97             ptr++;
    98         }
    99         if (*ptr == '.') {
    100             ptr++;
    101             while (isdigit(*ptr)) {
    102                 vpatch = 10 * vpatch + *ptr - '0';
    103                 ptr++;
    104             }
    105         }
    106     }
    107 
    108     if (vmajor != PR_VMAJOR) {
    109         return PR_FALSE;
    110     }
    111     if (vmajor == PR_VMAJOR && vminor > PR_VMINOR) {
    112         return PR_FALSE;
    113     }
    114     if (vmajor == PR_VMAJOR && vminor == PR_VMINOR && vpatch > PR_VPATCH) {
    115         return PR_FALSE;
    116     }
    117     return PR_TRUE;
    118 }  /* PR_VersionCheck */
    11971
    12072
     
    163115    _PR_InitIO();
    164116    _PR_InitLog();
    165     _PR_InitCallOnce();
    166117    _PR_InitDtoa();
    167118
     
    174125{
    175126        _PR_InitStuff();
    176 }
    177 
    178 PR_IMPLEMENT(void) PR_DisableClockInterrupts(void)
    179 {
    180 }
    181 
    182 PR_IMPLEMENT(void) PR_EnableClockInterrupts(void)
    183 {
    184 }
    185 
    186 PR_IMPLEMENT(void) PR_BlockClockInterrupts(void)
    187 {
    188 }
    189 
    190 PR_IMPLEMENT(void) PR_UnblockClockInterrupts(void)
    191 {
    192127}
    193128
     
    483418}
    484419
    485 /*
    486  ********************************************************************
    487  *
    488  * Module initialization
    489  *
    490  ********************************************************************
    491  */
    492 
    493 static struct {
    494     PRLock *ml;
    495     PRCondVar *cv;
    496 } mod_init;
    497 
    498 static void _PR_InitCallOnce(void) {
    499     mod_init.ml = PR_NewLock();
    500     PR_ASSERT(NULL != mod_init.ml);
    501     mod_init.cv = PR_NewCondVar(mod_init.ml);
    502     PR_ASSERT(NULL != mod_init.cv);
    503 }
    504 
    505 void _PR_CleanupCallOnce()
    506 {
    507     PR_DestroyLock(mod_init.ml);
    508     mod_init.ml = NULL;
    509     PR_DestroyCondVar(mod_init.cv);
    510     mod_init.cv = NULL;
    511 }
    512 
    513 PR_IMPLEMENT(PRStatus) PR_CallOnce(
    514     PRCallOnceType *once,
    515     PRCallOnceFN    func)
    516 {
    517     if (!_pr_initialized) _PR_ImplicitInitialization();
    518 
    519     if (!once->initialized) {
    520         if (PR_AtomicSet(&once->inProgress, 1) == 0) {
    521             once->status = (*func)();
    522             PR_Lock(mod_init.ml);
    523             once->initialized = 1;
    524             PR_NotifyAllCondVar(mod_init.cv);
    525             PR_Unlock(mod_init.ml);
    526         } else {
    527             PR_Lock(mod_init.ml);
    528             while (!once->initialized) {
    529                 PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);
    530             }
    531             PR_Unlock(mod_init.ml);
    532         }
    533     }
    534     return once->status;
    535 }
    536 
    537 PR_IMPLEMENT(PRStatus) PR_CallOnceWithArg(
    538     PRCallOnceType      *once,
    539     PRCallOnceWithArgFN  func,
    540     void                *arg)
    541 {
    542     if (!_pr_initialized) _PR_ImplicitInitialization();
    543 
    544     if (!once->initialized) {
    545         if (PR_AtomicSet(&once->inProgress, 1) == 0) {
    546             once->status = (*func)(arg);
    547             PR_Lock(mod_init.ml);
    548             once->initialized = 1;
    549             PR_NotifyAllCondVar(mod_init.cv);
    550             PR_Unlock(mod_init.ml);
    551         } else {
    552             PR_Lock(mod_init.ml);
    553             while (!once->initialized) {
    554                 PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);
    555             }
    556             PR_Unlock(mod_init.ml);
    557         }
    558     }
    559     return once->status;
    560 }
    561 
    562 PRBool _PR_Obsolete(const char *obsolete, const char *preferred)
    563 {
    564 #if defined(DEBUG)
    565     PR_fprintf(
    566         PR_STDERR, "'%s' is obsolete. Use '%s' instead.\n",
    567         obsolete, (NULL == preferred) ? "something else" : preferred);
    568 #endif
    569     return PR_FALSE;
    570 }  /* _PR_Obsolete */
    571 
    572420/* prinit.c */
    573421
    574 
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptthread.c

    r101945 r101947  
    656656
    657657        _PR_CleanupDtoa();
    658         _PR_CleanupCallOnce();
    659658        _PR_LogCleanup();
    660659        /* Close all the fd's before calling _PR_CleanupIO */
Note: See TracChangeset for help on using the changeset viewer.

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