{"comment":{"created_at":"2012-01-01T06:36:58Z","user":{"id":604851,"login":"nicowilliams","url":"https://api.github.com/users/nicowilliams","avatar_url":"https://secure.gravatar.com/avatar/d12b4a0e6b76d5b05907d9af1217f8e4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d12b4a0e6b76d5b05907d9af1217f8e4"},"path":"base/db.c","updated_at":"2012-01-01T06:36:58Z","id":830151,"html_url":"https://github.com/nicowilliams/heimdal/commit/6fce54a5b1#commitcomment-830151","position":126,"body":"Well, if you look at this commit: 004464607a9029ae3a01e07ca63c66007861eb01 (in my pgss branch) you'll see that there's a nice, portable, BSD-licensed library of atomic operations (on many CPUs, OSes, and with many compilers) including: increment, decrement, test-and-set, CAS, and memory barriers.  As long as we use things like heim_once() and that maps to pthread_once() or W32 equivalent, we're OK for this sort of thing.  I really don't see what's wrong with the above code, except that it'd be nice to have a nice memory model in C -- but we don't.","url":"https://api.github.com/repos/nicowilliams/heimdal/comments/830151","commit_id":"6fce54a5b1f68e3fb6007bb17da5038bb7eb8489","line":126}}