Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: userland atomics

On Dec 12, 2008, at 6:58 PM, John Nemeth wrote:

Do we have any kind of atomic operations in userland? I'm working
with Asterisk on NetBSD 5.99.3.  Its configure script trys to
link this program (along with a lot of #define):

main ()
int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);
  return 0;

For some reason, the corfigure script believes that it is successful;
however, linking of Asterisk fails later due to a missing symbol.

That's because in a gcc later than ours that becomes a builtin to gcc.

What you want to look at is atomic_ops(3).

Home | Main Index | Thread Index | Old Index