VirtualBox

Changeset 101983 in vbox


Ignore:
Timestamp:
Nov 8, 2023 3:34:44 PM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Remove unused PR_Sleep, bugref:10545

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

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/misc/prinit.c

    r101969 r101983  
    6666PRFileDesc *_pr_stderr;
    6767
    68 PRLock *_pr_sleeplock;  /* used in PR_Sleep(), classic and pthreads */
    69 
    7068PRBool _pr_initialized = PR_FALSE;
    7169
     
    104102    _PR_InitLocks();
    105103    _PR_InitClock();
    106 
    107     _pr_sleeplock = PR_NewLock();
    108     PR_ASSERT(NULL != _pr_sleeplock);
    109104
    110105    _PR_InitThreads(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptthread.c

    r101968 r101983  
    6363
    6464static PRIntn pt_schedpriv = 0;
    65 extern PRLock *_pr_sleeplock;
    6665
    6766static struct _PT_Bookeeping
     
    508507}  /* PR_Interrupt */
    509508
    510 PR_IMPLEMENT(PRStatus) PR_Sleep(PRIntervalTime ticks)
    511 {
    512     PRStatus rv = PR_SUCCESS;
    513 
    514     if (!_pr_initialized) _PR_ImplicitInitialization();
    515 
    516     if (PR_INTERVAL_NO_WAIT == ticks)
    517     {
    518         _PT_PTHREAD_YIELD();
    519     }
    520     else
    521     {
    522         PRCondVar *cv;
    523         PRIntervalTime timein;
    524 
    525         timein = PR_IntervalNow();
    526         cv = PR_NewCondVar(_pr_sleeplock);
    527         PR_ASSERT(cv != NULL);
    528         PR_Lock(_pr_sleeplock);
    529         do
    530         {
    531             PRIntervalTime now = PR_IntervalNow();
    532             PRIntervalTime delta = now - timein;
    533             if (delta > ticks) break;
    534             rv = PR_WaitCondVar(cv, ticks - delta);
    535         } while (PR_SUCCESS == rv);
    536         PR_Unlock(_pr_sleeplock);
    537         PR_DestroyCondVar(cv);
    538     }
    539     return rv;
    540 }  /* PR_Sleep */
    541 
    542509static void _pt_thread_death(void *arg)
    543510{
     
    673640        }
    674641        _pt_thread_death(me);
    675         PR_DestroyLock(_pr_sleeplock);
    676         _pr_sleeplock = NULL;
     642
    677643        _pr_initialized = PR_FALSE;
    678644        return PR_SUCCESS;
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