1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Modernize atomics

- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
This commit is contained in:
Pedro J. Estébanez
2021-01-31 13:34:42 +01:00
parent 6d89f675b1
commit 4485b43a57
54 changed files with 641 additions and 676 deletions

View File

@@ -33,6 +33,8 @@
#include "editor/editor_resource_preview.h"
#include "core/safe_refcount.h"
void post_process_preview(Ref<Image> p_image);
class EditorTexturePreviewPlugin : public EditorResourcePreviewGenerator {
@@ -92,7 +94,7 @@ class EditorMaterialPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2;
RID light_instance2;
RID camera;
mutable volatile bool preview_done;
mutable SafeFlag preview_done;
void _preview_done(const Variant &p_udata);
@@ -137,7 +139,7 @@ class EditorMeshPreviewPlugin : public EditorResourcePreviewGenerator {
RID light2;
RID light_instance2;
RID camera;
mutable volatile bool preview_done;
mutable SafeFlag preview_done;
void _preview_done(const Variant &p_udata);
@@ -160,7 +162,7 @@ class EditorFontPreviewPlugin : public EditorResourcePreviewGenerator {
RID viewport_texture;
RID canvas;
RID canvas_item;
mutable volatile bool preview_done;
mutable SafeFlag preview_done;
void _preview_done(const Variant &p_udata);