diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-12-31 14:23:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-31 14:23:24 +0100 |
commit | cce736218f465511194465410e1ba23b5530e46f (patch) | |
tree | 02f488ea361a4fba8aec92e44193d8627836cd55 /src/nvim/ui_bridge.h | |
parent | 99cf111289bfcd14981255e805da43bac5139141 (diff) | |
parent | 9fdcbbb4063daa125e420e0ffe9dae6801c264bc (diff) | |
download | rneovim-cce736218f465511194465410e1ba23b5530e46f.tar.gz rneovim-cce736218f465511194465410e1ba23b5530e46f.tar.bz2 rneovim-cce736218f465511194465410e1ba23b5530e46f.zip |
Merge pull request #18375 from bfredl/tui_rework
feat(ui): refactor TUI from thread to separate process
Diffstat (limited to 'src/nvim/ui_bridge.h')
-rw-r--r-- | src/nvim/ui_bridge.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/nvim/ui_bridge.h b/src/nvim/ui_bridge.h deleted file mode 100644 index 094367126a..0000000000 --- a/src/nvim/ui_bridge.h +++ /dev/null @@ -1,47 +0,0 @@ -// Bridge for communication between a UI thread and nvim core. -// Used by the built-in TUI and libnvim-based UIs. -#ifndef NVIM_UI_BRIDGE_H -#define NVIM_UI_BRIDGE_H - -#include <stdbool.h> -#include <uv.h> - -#include "nvim/event/defs.h" -#include "nvim/ui.h" - -struct ui_bridge_data; - -typedef struct ui_bridge_data UIBridgeData; -typedef void (*ui_main_fn)(UIBridgeData *bridge, UI *ui); -struct ui_bridge_data { - UI bridge; // actual UI passed to ui_attach - UI *ui; // UI pointer that will have its callback called in - // another thread - event_scheduler scheduler; - uv_thread_t ui_thread; - ui_main_fn ui_main; - uv_mutex_t mutex; - uv_cond_t cond; - // When the UI thread is called, the main thread will suspend until - // the call returns. This flag is used as a condition for the main - // thread to continue. - bool ready; - // When a stop request is sent from the main thread, it must wait until the UI - // thread finishes handling all events. This flag is set by the UI thread as a - // signal that it will no longer send messages to the main thread. - bool stopped; -}; - -#define CONTINUE(b) \ - do { \ - UIBridgeData *d = (UIBridgeData *)b; \ - uv_mutex_lock(&d->mutex); \ - d->ready = true; \ - uv_cond_signal(&d->cond); \ - uv_mutex_unlock(&d->mutex); \ - } while (0) - -#ifdef INCLUDE_GENERATED_DECLARATIONS -# include "ui_bridge.h.generated.h" -#endif -#endif // NVIM_UI_BRIDGE_H |