Changeset 7c844e3 in rtems
- Timestamp:
- 05/17/02 18:03:34 (22 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- c0af822e
- Parents:
- cb3a7ed
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/libcsupport/src/envlock.c
rcb3a7ed r7c844e3 1 1 /* 2 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 3 * 2 4 * $Id$ 3 *4 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/20025 5 */ 6 6 … … 30 30 * - NEWLIB-1.8.2 has an ugly BUG: if environ is NULL, _findenv_r() bails 31 31 * out leaving the lock held :-( 32 * 33 * Used by the following functions: 34 * findenv_r(), setenv_r(), and unsetenv_r() which are called by 35 * getenv(), getenv_r(), setenv(), and unsetenv(). 32 36 * 33 37 */ 34 38 39 #if defined(ENVLOCK_DEDIDCATED_MUTEX) 35 40 static rtems_id envLock=0; 36 41 … … 81 86 rtems_semaphore_release(envLock); 82 87 } 88 #else 89 90 /* 91 * Reuse the libio mutex -- it is always initialized before we 92 * could possibly run. 93 */ 94 95 #include <rtems/libio_.h> 96 97 void 98 __env_lock(struct _reent *r) 99 { 100 rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 101 } 102 103 void 104 __env_unlock(struct _reent *r) 105 { 106 rtems_semaphore_release( rtems_libio_semaphore ); 107 } 108 #endif -
c/src/lib/ChangeLog
rcb3a7ed r7c844e3 1 2001-05-17 Joel Sherrill <joel@OARcorp.com> 2 3 * libc/envlock.c: Implemented code to let newlib's envlock share 4 the libio open/close mutex. Since both should be lightly used, 5 this should not lead to problems and saves resources. 6 1 7 2002-05-15 Chris Johns <ccj@acm.org> 2 8 -
c/src/lib/libc/envlock.c
rcb3a7ed r7c844e3 1 1 /* 2 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 3 * 2 4 * $Id$ 3 *4 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/20025 5 */ 6 6 … … 30 30 * - NEWLIB-1.8.2 has an ugly BUG: if environ is NULL, _findenv_r() bails 31 31 * out leaving the lock held :-( 32 * 33 * Used by the following functions: 34 * findenv_r(), setenv_r(), and unsetenv_r() which are called by 35 * getenv(), getenv_r(), setenv(), and unsetenv(). 32 36 * 33 37 */ 34 38 39 #if defined(ENVLOCK_DEDIDCATED_MUTEX) 35 40 static rtems_id envLock=0; 36 41 … … 81 86 rtems_semaphore_release(envLock); 82 87 } 88 #else 89 90 /* 91 * Reuse the libio mutex -- it is always initialized before we 92 * could possibly run. 93 */ 94 95 #include <rtems/libio_.h> 96 97 void 98 __env_lock(struct _reent *r) 99 { 100 rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 101 } 102 103 void 104 __env_unlock(struct _reent *r) 105 { 106 rtems_semaphore_release( rtems_libio_semaphore ); 107 } 108 #endif -
cpukit/libcsupport/src/envlock.c
rcb3a7ed r7c844e3 1 1 /* 2 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/2002 3 * 2 4 * $Id$ 3 *4 * Author: Till Straumann <strauman@slac.stanford.edu>, 3/20025 5 */ 6 6 … … 30 30 * - NEWLIB-1.8.2 has an ugly BUG: if environ is NULL, _findenv_r() bails 31 31 * out leaving the lock held :-( 32 * 33 * Used by the following functions: 34 * findenv_r(), setenv_r(), and unsetenv_r() which are called by 35 * getenv(), getenv_r(), setenv(), and unsetenv(). 32 36 * 33 37 */ 34 38 39 #if defined(ENVLOCK_DEDIDCATED_MUTEX) 35 40 static rtems_id envLock=0; 36 41 … … 81 86 rtems_semaphore_release(envLock); 82 87 } 88 #else 89 90 /* 91 * Reuse the libio mutex -- it is always initialized before we 92 * could possibly run. 93 */ 94 95 #include <rtems/libio_.h> 96 97 void 98 __env_lock(struct _reent *r) 99 { 100 rtems_semaphore_obtain( rtems_libio_semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); 101 } 102 103 void 104 __env_unlock(struct _reent *r) 105 { 106 rtems_semaphore_release( rtems_libio_semaphore ); 107 } 108 #endif
Note: See TracChangeset
for help on using the changeset viewer.