util/u_atomic: Add new macro p_atomic_add
authorCarl Worth <cworth@cworth.org>
Thu, 5 Feb 2015 23:36:59 +0000 (15:36 -0800)
committerCarl Worth <cworth@cworth.org>
Mon, 9 Feb 2015 18:47:44 +0000 (10:47 -0800)
commitb16de0b713fb4d5d1c5600d126e4ce945fc27303
tree5515a59772d2fe67ed7a5d1883619c59a2e06071
parent345e8cc8496b4e6c56105c7396e80d85a37e122c
util/u_atomic: Add new macro p_atomic_add

This provides for atomic addition, which will be used by an upcoming
shader-cache patch. A simple test is added to "make check" as well.

Note: The various O/S functions differ on whether they return the
original value or the value after the addition, so I did not provide
an add_return() macro which would be sensitive to that difference.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/util/u_atomic.h
src/util/u_atomic_test.c