Chris Robinson
4c33818dde
Avoid duplicating code using a macro
2016-12-21 19:58:03 -08:00
Chris Robinson
8f581c0e66
Use separate macros for atomics that don't take a memory order
2016-12-20 20:49:37 -08:00
Chris Robinson
02a6031d03
Use atomic flags for boolean atomic locks
2016-11-25 23:25:16 -08:00
Chris Robinson
c618971758
Remove the non-atomic COMPARE_EXCHANGE macro
2016-11-22 03:00:16 -08:00
Chris Robinson
616adea4cc
Improve seqlock behavior
2016-11-21 23:58:28 -08:00
Chris Robinson
6a91d6a10a
Add support for 8-byte types on inline assembly ATOMIC_ADD/SUB
2016-11-03 23:47:50 -07:00
Chris Robinson
82e8dd0525
Fix win32 atomic fallbacks
2016-11-03 15:32:31 -07:00
Chris Robinson
815947492c
Remove the explicit type from ATOMIC_ADD and ATOMIC_SUB
2016-11-03 01:22:29 -07:00
Chris Robinson
01f3e33df9
Remove a couple unneeded functions
2016-05-25 06:45:56 -07:00
Chris Robinson
f38e88bc29
Allow optional memory ordering to atomic methods
...
Currently only C11 atomics make use of the memory order. If not
specified, it defaults to almemory_order_seq_cst.
2014-09-07 00:42:50 -07:00
Chris Robinson
4b53d0e90c
Make ExchangeInt and ExchangePtr non-atomic
2014-09-03 17:37:07 -07:00
Chris Robinson
f5194a9d8e
Use an ATOMIC_INIT macro instead of ATOMIC_LOAD_UNSAFE
2014-08-03 00:26:21 -07:00
Chris Robinson
659b340716
Use the right type for atomic compare-exchange
2014-08-01 02:47:46 -07:00
Chris Robinson
1c1e878be7
Add some casts for inline assembly atomics
...
And remove an unnecessary void cast
2014-08-01 02:40:25 -07:00
Chris Robinson
87423f046e
Use atomics for the device and context list heads
2014-08-01 02:04:40 -07:00
Chris Robinson
cdfc5a4d31
Remove an unused function
2014-07-31 04:44:39 -07:00
Chris Robinson
ce046d2f03
Rename ATOMIC_COMPARE_EXCHANGE to ATOMIC_COMPARE_EXCHANGE_STRONG
2014-07-31 04:34:46 -07:00
Chris Robinson
6ce464aed8
Avoid a CPU memory fence, and better order memory barriers to accesses
...
Code produced by GCC 4.9's C11 atomic implementation does not seem to add a
CPU memory fence even with memory_order_seq_cst. Unnecessary memory fences
will be a detriment to performance, so they should only be added if needed.
2014-07-31 04:19:33 -07:00
Chris Robinson
7c847e62c3
Change Windows-based atomics for non-C99 compilers
2014-07-27 19:34:32 -07:00
Chris Robinson
38e8dc8540
Use a full memory barrier for Windows
2014-07-27 18:31:10 -07:00
Chris Robinson
531c0d8e6b
Explicitly pass the address of atomics and parameters that can be modified
2014-07-26 03:00:49 -07:00
Chris Robinson
a3dbe08c8b
Support C11 atomics
2014-07-23 06:36:34 -07:00
Chris Robinson
a3b1d4a5e2
Implement RefCount as a generic atomic type
2014-07-22 18:18:14 -07:00
Chris Robinson
5a339a2a5b
Add macros for generic atomic functionality
2014-07-22 00:20:28 -07:00
Chris Robinson
1d45c439b8
Add extern "C" to common headers.
2014-05-29 04:22:30 -07:00
Chris Robinson
73614f228e
Add methods to exchange and compare-exchange RefCount values
2014-05-27 15:48:15 -07:00
Chris Robinson
1d2504d12e
Make RefCount a non-integer type
...
It should only be accessed through the appropriate functions to ensure proper
atomicity.
2014-05-14 02:47:07 -07:00
Chris Robinson
8b7c71e20e
Always use unsigned int for RefCount
2014-05-07 23:49:06 -07:00
Chris Robinson
1c01e94237
Move the static_assert definition to its own header
2014-05-07 02:28:25 -07:00
Chris Robinson
0ea979a262
Move some headers to include/
...
Note, these are not installed. Only headers in include/AL/ are installed.
2014-05-06 18:29:53 -07:00