Saverio Miroddi 7f50fe3ea0 Remove KEYBOARD_HOOKED unsafe code, by using AtomicBool
For supported types, static R/W globals unsafe code can be replaced by safe `Atomic*` types.

The pattern of usage is simple:

- AtomicBool#swap is used to fetch the old `KEYBOARD_HOOKED` value, while setting it to true;
- if the old value was true, there is effectively no change to `KEYBOARD_HOOKED`, and the flow exits from the enclosing function;
- if the old value was false, execute the function (the new `KEYBOARD_HOOKED` has been set to true by swap()).

The most conservative ordering is used, as the context is not performance-sensitive.

Atomics are not supported on every platform, but the project assumes x86-64, which supports them.
2022-05-22 18:48:08 +02:00
..
2022-04-04 15:00:26 +08:00
2021-03-29 15:59:14 +08:00
2022-05-18 15:45:45 +08:00
2022-05-12 17:35:25 +08:00
2022-05-12 17:35:25 +08:00
2022-05-16 14:45:17 +08:00
2022-05-16 14:45:17 +08:00
2022-03-28 19:05:12 +08:00
2022-04-26 00:46:21 +08:00
2022-05-12 17:35:25 +08:00
2022-02-01 02:38:52 +08:00
2022-05-12 17:35:25 +08:00
2022-05-12 17:35:25 +08:00
2022-04-29 16:21:18 +08:00
2021-12-25 16:45:22 +08:00
2022-02-01 02:38:52 +08:00
2022-05-12 17:35:25 +08:00