diff options
author | Mike Hommey <mh@glandium.org> | 2021-11-30 22:08:11 +0000 |
---|---|---|
committer | Mike Hommey <mh@glandium.org> | 2021-11-30 22:08:11 +0000 |
commit | c90e474afce22b463d14214922a900f3f889edb2 (patch) | |
tree | 071c8fb4429ab77e525697804454e9e2867aff66 | |
parent | 63866f8d5ea05b853792e99044756b3928e9d490 (diff) | |
download | nspr-hg-c90e474afce22b463d14214922a900f3f889edb2.tar.gz |
Bug 1299823 - Rename PR_X* symbols, remove unused ones. r=kaieNSPR_4_33_BETA1
None of these symbols are in a public header, they are not NSPR_API, and
only available on XP_UNIX builds, which in the vast majority of cases,
means built with -fvisibility=hidden (i.e. the symbols are not even
exported in the first place).
The convention for non-exported symbols is to start with _PR rather than
PR, so we rename those symbols.
The PR_XWait, PR_XNotify and PR_XNotifyAll symbols are however never used,
so we just remove them.
Differential Revision: https://phabricator.services.mozilla.com/D132448
-rw-r--r-- | pr/include/private/pprthred.h | 6 | ||||
-rw-r--r-- | pr/src/md/unix/unix.c | 21 | ||||
-rw-r--r-- | pr/src/md/unix/uxwrap.c | 6 |
3 files changed, 9 insertions, 24 deletions
diff --git a/pr/include/private/pprthred.h b/pr/include/private/pprthred.h index e566d8ad..9b7c3c19 100644 --- a/pr/include/private/pprthred.h +++ b/pr/include/private/pprthred.h @@ -301,9 +301,9 @@ NSPR_API(void) PR_OS2_UnsetFloatExcpHandler(EXCEPTIONREGISTRATIONRECORD* e); ---------------------------------------------------------------------------*/ #ifdef XP_UNIX -extern void PR_XLock(void); -extern void PR_XUnlock(void); -extern PRBool PR_XIsLocked(void); +extern void _PR_XLock(void); +extern void _PR_XUnlock(void); +extern PRBool _PR_XIsLocked(void); #endif /* XP_UNIX */ PR_END_EXTERN_C diff --git a/pr/src/md/unix/unix.c b/pr/src/md/unix/unix.c index 56b58aa7..d9e35925 100644 --- a/pr/src/md/unix/unix.c +++ b/pr/src/md/unix/unix.c @@ -3301,36 +3301,21 @@ int _MD_unix_get_nonblocking_connect_error(int osfd) ** in a pre-emptive threaded environment, we need to use a lock. */ -void PR_XLock(void) +void _PR_XLock(void) { PR_EnterMonitor(_pr_Xfe_mon); } -void PR_XUnlock(void) +void _PR_XUnlock(void) { PR_ExitMonitor(_pr_Xfe_mon); } -PRBool PR_XIsLocked(void) +PRBool _PR_XIsLocked(void) { return (PR_InMonitor(_pr_Xfe_mon)) ? PR_TRUE : PR_FALSE; } -void PR_XWait(int ms) -{ - PR_Wait(_pr_Xfe_mon, PR_MillisecondsToInterval(ms)); -} - -void PR_XNotify(void) -{ - PR_Notify(_pr_Xfe_mon); -} - -void PR_XNotifyAll(void) -{ - PR_NotifyAll(_pr_Xfe_mon); -} - #if defined(HAVE_FCNTL_FILE_LOCKING) PRStatus diff --git a/pr/src/md/unix/uxwrap.c b/pr/src/md/unix/uxwrap.c index d6f6d062..e0ddc50e 100644 --- a/pr/src/md/unix/uxwrap.c +++ b/pr/src/md/unix/uxwrap.c @@ -187,10 +187,10 @@ int select(int width, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tv) needToLockXAgain = 0; if (rd && (_pr_xt_hack_fd != -1) - && FD_ISSET(_pr_xt_hack_fd, rd) && PR_XIsLocked() + && FD_ISSET(_pr_xt_hack_fd, rd) && _PR_XIsLocked() && (!_pr_xt_hack_okayToReleaseXLock || _pr_xt_hack_okayToReleaseXLock())) { - PR_XUnlock(); + _PR_XUnlock(); needToLockXAgain = 1; } @@ -198,7 +198,7 @@ int select(int width, fd_set *rd, fd_set *wr, fd_set *ex, struct timeval *tv) retVal = _PR_WaitForMultipleFDs(unixpds, pdcnt, timeout); if (needToLockXAgain) { - PR_XLock(); + _PR_XLock(); } } |