libsmbclient threadsafeness

Michael B Allen mba2000 at ioplex.com
Mon Oct 18 23:26:34 GMT 2004


David Wuertele said:
> This is essentially what I've done, but inline without defining a
> function.  Since I've done it for every call into libsmbclient
> already, I'm now going to try backing off things that probably don't
> need it, like "pull_ascii_fstring()" and the like.

I know something like this might not look like it has threading problems
and I don't know anything about this function but there are a lot of ways
to ruin thread-ability. Consider something like:

const char *
pull_foo(void)
   static char buf[64];
   ...
   return buf;
}

And this will look like it works until one day you get a foo someone else
was working on :(

Mike


More information about the samba-technical mailing list