"Note Each function uses a static variable for parsing the string into
tokens. If multiple or simultaneous calls are made to the same function,
a high potential for data corruption and inaccurate results exists.
Therefore, do not attempt to call the same function simultaneously for
different strings and be aware of calling one of these functions from
within a loop where another routine may be called that uses the same
function. However, calling this function simultaneously from multiple
threads does not have undesirable effects."
So calling this function simultaneously from multiple threads does not
have undesirable effects. I am wondering how I can call this function
simultaneously within the same thread.
This wording is indeed confusing.
Historically, strtok() is neither useful for multiple separate calls nor for
concurrent calls. You can make the buffers thread-local, making simultaneous
calls by different threads safe. That is probably what MS did and documented
with the last sentence, but be aware that is only guaranteed by that
particular implementation.
Uli