Print this page
Thread safety fixes.

@@ -8,11 +8,11 @@
  * 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>
+ * Copyright 2014 Garrett D'Amore <garrett@damore.org>
  */
 
 /*
  * This file implements the 2008 newlocale and friends handling. It is
  * private to libc.

@@ -48,16 +48,17 @@
 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 locdata  *l_next;                        /* link cached list */
 };
 
 
 struct locale {
         struct locdata  *locdata[LC_ALL];
+        struct locale   *next;
 
         /*
          * Convenience pointers.
          */
         const struct lc_ctype           *ctype;

@@ -79,12 +80,11 @@
         struct lconv    lconv;
 };
 
 
 struct locdata *__locdata_alloc(const char *, size_t);
-struct locdata *__locdata_hold(struct locdata *);
-void __locdata_release(struct locdata *);
+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);