>From the man page "The *strtok*() function uses a static buffer while parsing, so it's not thread safe. Use *strtok_r*() if this matters to you."
I tested it and it appears to work fine as patched and I don't think we need the arg parsing to be thread safe in this app as currently written. Mike On 12 January 2015 at 12:02, Mike Holmes <[email protected]> wrote: > Agree that if it is in single threaded section we keep the possibility of > including more than we want out by not defining POSIX. > > > On 12 January 2015 at 10:47, Maxim Uvarov <[email protected]> wrote: > >> On 01/12/2015 03:22 PM, Ola Liljedahl wrote: >> >>> strtok() is not thread-safe and thus doesn't seem like a great idea to >>> use it in a multithreaded application based on ODP. I don't know about >>> this exact usage here, perhaps this argument parsing is always only >>> going to happen in a single thread? >>> >> parse_args() done before any threads init. So it's safe here. If strtok >> is defined then >> it's better to go with it then define POSIX. >> >> +1 For Ciprians solution. >> >> Maxim. >> >> >> _______________________________________________ >> lng-odp mailing list >> [email protected] >> http://lists.linaro.org/mailman/listinfo/lng-odp >> > > > > -- > *Mike Holmes* > Linaro Sr Technical Manager > LNG - ODP > -- *Mike Holmes* Linaro Sr Technical Manager LNG - ODP
_______________________________________________ lng-odp mailing list [email protected] http://lists.linaro.org/mailman/listinfo/lng-odp
