comparison libtwamr/tls_flags.c @ 252:57b4053559ff

libtwamr: beginning of project
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 05 Apr 2024 01:02:23 +0000
parents libgsmefr/tls_flags.c@38326102fc43
children dfb1f86541b2
comparison
equal deleted inserted replaced
251:946849291027 252:57b4053559ff
1 /*
2 * Unfortunately the code we got from ETSI makes heavy use of two global
3 * Boolean flags named Carry and Overflow that function like equally named
4 * processor state flags on many CPU architectures. They are not part
5 * of persistent codec session state for either the encoder or the decoder,
6 * instead they are "short-term" globals much like UNIX errno.
7 *
8 * Given this unfortunate reality plus the natural desire to make our
9 * AMR library thread-safe (a transcoding MGW handling a large volume of
10 * simultaneous calls is exactly the kind of application that would benefit
11 * from utilitizing all CPU cores), our current workaround is to use
12 * thread-local storage.
13 */
14
15 #include <stdint.h>
16 #include "typedef.h"
17
18 __thread Flag AMR__Carry, AMR__Overflow;