From ddc8afd422568750de7698d8a92b79b27599dd2f Mon Sep 17 00:00:00 2001 From: John Birrell Date: Tue, 9 Jun 1998 23:21:05 +0000 Subject: Implement compile time debug support instead of tracking file name and line number every time a file descriptor is locked. This looks like a big change but it isn't. It should reduce the size of libc_r and make it run slightly faster. --- lib/libpthread/thread/thr_select.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libpthread/thread/thr_select.c') diff --git a/lib/libpthread/thread/thr_select.c b/lib/libpthread/thread/thr_select.c index 96df9c19bf54d..0211883cc1b2b 100644 --- a/lib/libpthread/thread/thr_select.c +++ b/lib/libpthread/thread/thr_select.c @@ -73,13 +73,13 @@ select(int numfds, fd_set * readfds, fd_set * writefds, for (i = 0; i < numfds; i++) { if ((readfds && (FD_ISSET(i, readfds))) || (exceptfds && FD_ISSET(i, exceptfds))) { if (writefds && FD_ISSET(i, writefds)) { - if ((ret = _thread_fd_lock(i, FD_RDWR, NULL, __FILE__, __LINE__)) != 0) { + if ((ret = _FD_LOCK(i, FD_RDWR, NULL)) != 0) { got_all_locks = 0; break; } FD_SET(i, &rdwr_locks); } else { - if ((ret = _thread_fd_lock(i, FD_READ, NULL, __FILE__, __LINE__)) != 0) { + if ((ret = _FD_LOCK(i, FD_READ, NULL)) != 0) { got_all_locks = 0; break; } @@ -87,7 +87,7 @@ select(int numfds, fd_set * readfds, fd_set * writefds, } } else { if (writefds && FD_ISSET(i, writefds)) { - if ((ret = _thread_fd_lock(i, FD_WRITE, NULL, __FILE__, __LINE__)) != 0) { + if ((ret = _FD_LOCK(i, FD_WRITE, NULL)) != 0) { got_all_locks = 0; break; } @@ -137,13 +137,13 @@ select(int numfds, fd_set * readfds, fd_set * writefds, /* clean up the locks */ for (i = 0; i < numfds; i++) if (FD_ISSET(i, &read_locks)) - _thread_fd_unlock(i, FD_READ); + _FD_UNLOCK(i, FD_READ); for (i = 0; i < numfds; i++) if (FD_ISSET(i, &rdwr_locks)) - _thread_fd_unlock(i, FD_RDWR); + _FD_UNLOCK(i, FD_RDWR); for (i = 0; i < numfds; i++) if (FD_ISSET(i, &write_locks)) - _thread_fd_unlock(i, FD_WRITE); + _FD_UNLOCK(i, FD_WRITE); if (ret > 0) { if (readfds != NULL) { -- cgit v1.3