comparison lib/localcharset.c @ 2324:056ab4fe3d27

Add Bruno's comment justifying use of volatile.
author Jim Meyering <jim@meyering.net>
date Sat, 04 Mar 2000 07:57:35 +0000
parents 9bddfd20456d
children 3dfb80bf846b
comparison
equal deleted inserted replaced
2323:12ab2a810b6d 2324:056ab4fe3d27
46 #endif 46 #endif
47 47
48 char *xmalloc (); 48 char *xmalloc ();
49 char *xrealloc (); 49 char *xrealloc ();
50 50
51 /* The following static variable is declared 'volatile' to avoid a
52 possible multithread problem in the function get_charset_aliases. If we
53 are running in a threaded environment, and if two threads initialize
54 'charset_aliases' simultaneously, both will produce the same value,
55 and everything will be ok if the two assignments to 'charset_aliases'
56 are atomic. But I don't know what will happen if the two assignments mix. */
51 /* Pointer to the contents of the charset.alias file, if it has already been 57 /* Pointer to the contents of the charset.alias file, if it has already been
52 read, else NULL. Its format is: 58 read, else NULL. Its format is:
53 ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ 59 ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */
54 static char * volatile charset_aliases; 60 static char * volatile charset_aliases;
55 61