[Issue 1478] Please use threadsafe functions in getHostByName
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Sun Oct 14 14:40:03 PDT 2007
    
    
  
http://d.puremagic.com/issues/show_bug.cgi?id=1478
------- Comment #2 from braddr at puremagic.com  2007-10-14 16:40 -------
downs:  I saw your comments in scrollback on irc.  Two comments:
1) thanks.. you're right about the need to globally synchronize and not
per-class-instance synchronize.  I've fixed that:
- synchronized he = gethostbyname(toStringz(name));
+ synchronized(this.classinfo) he = gethostbyname(toStringz(name));
2) Regarding the use of static if, that would only work if there was sufficient
configury mechanics to make sure that the _r versions were only included if
they exist.  All static if can see is what's been declared, not what actually
is linkable.  My main objection isn't really the declaration part of _r, but
the very wierd usage of needing to grow that buffer and iterate many times. 
That'd likely end up more expensive than just synching.
Thanks for catching #1.
Later,
Brad
-- 
    
    
More information about the Digitalmars-d-bugs
mailing list