Print this page
Thread safety fixes.

*** 8,18 **** * source. A copy of the CDDL is also available via the Internet at * http://www.illumos.org/license/CDDL. */ /* ! * Copyright 2013 Garrett D'Amore <garrett@damore.org> */ /* * This file implements the 2008 newlocale and friends handling. It is * private to libc. --- 8,18 ---- * source. A copy of the CDDL is also available via the Internet at * http://www.illumos.org/license/CDDL. */ /* ! * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ /* * This file implements the 2008 newlocale and friends handling. It is * private to libc.
*** 48,63 **** struct locdata { char l_lname[ENCODING_LEN+1]; /* locale name */ void *l_data[NLOCDATA]; /* storage area */ void *l_map; /* mapped file */ size_t l_map_len; ! uint32_t l_refcnt; }; struct locale { struct locdata *locdata[LC_ALL]; /* * Convenience pointers. */ const struct lc_ctype *ctype; --- 48,64 ---- struct locdata { char l_lname[ENCODING_LEN+1]; /* locale name */ void *l_data[NLOCDATA]; /* storage area */ void *l_map; /* mapped file */ size_t l_map_len; ! struct locdata *l_next; /* link cached list */ }; struct locale { struct locdata *locdata[LC_ALL]; + struct locale *next; /* * Convenience pointers. */ const struct lc_ctype *ctype;
*** 79,90 **** struct lconv lconv; }; struct locdata *__locdata_alloc(const char *, size_t); ! struct locdata *__locdata_hold(struct locdata *); ! void __locdata_release(struct locdata *); struct locdata *__locdata_get_cache(int, const char *); void __locdata_set_cache(int, struct locdata *); struct locdata *__lc_numeric_load(const char *name); struct locdata *__lc_monetary_load(const char *name); --- 80,90 ---- struct lconv lconv; }; struct locdata *__locdata_alloc(const char *, size_t); ! void __locdata_free(struct locdata *); struct locdata *__locdata_get_cache(int, const char *); void __locdata_set_cache(int, struct locdata *); struct locdata *__lc_numeric_load(const char *name); struct locdata *__lc_monetary_load(const char *name);