15 Commits

Author SHA1 Message Date
Johan Wikman
d68d3072a8 Make atomic_load_-functions const correct 2017-06-19 14:37:20 +03:00
Johan Wikman
f546a17e77 Update change date of 2.2 2017-06-01 10:24:20 +03:00
Markus Mäkelä
c7cffa0722 Add atomic compare-and-swap
The atomic compare-and-swap can be used to implement lock-free
structures. The planned use for this is to remove some of the locking done
in the services when listeners are being manipulated.
2017-05-09 15:28:04 +03:00
Markus Mäkelä
a4e361b5e5 Add atomic load/store operations on pointers
Added atomic operations on pointers. Also removed extra return statements
on void functions.
2017-05-04 09:17:48 +03:00
Esa Korhonen
bfd94c2b31 KILL [CONNECTION | QUERY] support, part1
Preparation for adding KILL syntax support.
Session id changed to uint32 everywhere. Added atomic op.
Session id can be acquired before session_alloc().
Added session_alloc_with_id(), which is given a session id number.
Worker object has a session_id->SESSION* mapping, not used yet.
2017-05-02 10:29:55 +03:00
Markus Mäkelä
601976dede Use __atomic builtins only where they are supported
Use the newer __atomic builtins only with GCC >= 4.7. The older __sync
builtins are used elsewhere.
2017-04-28 14:53:37 +03:00
Markus Mäkelä
19cf8c489e Rename atomic store and load functions
The atomic store and load functions are now called atomic_store_X and
atomic_load_X where X is one of int32, int64 or uint64.
2017-04-24 16:11:34 +03:00
Markus Mäkelä
122337569c Add atomic store and load operations
Added abstractions for storing and loading 32-bit and 64-bit values
atomically. The functions currently use the GCC __atomic builtin atomics.
2017-04-24 15:58:28 +03:00
Johan Wikman
a1d1413b24 Add atomic_add for 64-bit integers.
Now only GCC intrinsics are used.
2017-03-30 12:36:23 +03:00
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Johan Wikman
6b6fd83f26 Remove revision comments 2017-02-01 11:50:38 +02:00
Markus Makela
ded551e199 Add function for full memory barrier into maxscale/atomic.h
This allows safer lock-free reads to be done on lists that never shrink in
size. The main use-case for this is to allow servers to be added to a
service without locking the service each time a new session is created.

Synchronizing the memory before adding new components into a list
guarantees that if a session reads from the list and sees the new list
item, the memory pointed by the item is valid.
2016-11-07 14:10:18 +02:00
Johan Wikman
d7ce3ad75b Replace include guards with #pragma once 2016-10-26 08:23:15 +03:00
Johan Wikman
1a978be6b6 Cleanup header files
- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
2016-10-14 11:54:37 +03:00
Johan Wikman
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00