This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository terminology.

View the commit online.

commit 04faafa40c53734acd7cc5cd2971bf88f52008ff
Author: Cedric BAIL <[email protected]>
AuthorDate: Fri Nov 20 12:35:05 2026 -0600

    termpty: drop the no-op backlog lock
    
    termpty_backlog_lock() and termpty_backlog_unlock() have had empty
    bodies for years: the backlog is only touched from the main loop. The
    calls only suggested a locking discipline that does not exist.
---
 src/bin/backlog.c         | 20 --------------------
 src/bin/backlog.h         |  3 ---
 src/bin/termio.c          |  2 --
 src/bin/termiointernals.c | 23 +----------------------
 src/bin/termiolink.c      |  6 ------
 src/bin/termpty.c         |  8 --------
 6 files changed, 1 insertion(+), 61 deletions(-)

diff --git a/src/bin/backlog.c b/src/bin/backlog.c
index e5b28d18..d57ea5bd 100644
--- a/src/bin/backlog.c
+++ b/src/bin/backlog.c
@@ -35,17 +35,13 @@ termpty_backlog_memory_get(void)
 void
 termpty_save_register(Termpty *ty)
 {
-   termpty_backlog_lock();
    ptys = eina_list_append(ptys, ty);
-   termpty_backlog_unlock();
 }
 
 void
 termpty_save_unregister(Termpty *ty)
 {
-   termpty_backlog_lock();
    ptys = eina_list_remove(ptys, ty);
-   termpty_backlog_unlock();
 }
 
 Termsave *
@@ -141,16 +137,6 @@ termpty_save_free(Termpty *ty, Termsave *ts)
    ts->cap = 0;
 }
 
-void
-termpty_backlog_lock(void)
-{
-}
-
-void
-termpty_backlog_unlock(void)
-{
-}
-
 void
 termpty_backlog_free(Termpty *ty)
 {
@@ -174,13 +160,11 @@ termpty_clear_backlog(Termpty *ty)
    ty->backlog_beacon.screen_y = 0;
    ty->backlog_beacon.backlog_y = 0;
 
-   termpty_backlog_lock();
    termpty_backlog_free(ty);
    ty->backpos = 0;
    backsize = ty->backsize;
    ty->backsize = 0;
    termpty_backlog_size_set(ty, backsize);
-   termpty_backlog_unlock();
 }
 
 ssize_t
@@ -220,8 +204,6 @@ termpty_backlog_size_set(Termpty *ty, size_t size)
    if (ty->backsize == size)
      return;
 
-   termpty_backlog_lock();
-
    if (size == 0)
      {
         termpty_backlog_free(ty);
@@ -255,6 +237,4 @@ end:
    /* Reset beacon */
    ty->backlog_beacon.screen_y = 0;
    ty->backlog_beacon.backlog_y = 0;
-
-   termpty_backlog_unlock();
 }
diff --git a/src/bin/backlog.h b/src/bin/backlog.h
index 1a1e054f..da09764b 100644
--- a/src/bin/backlog.h
+++ b/src/bin/backlog.h
@@ -9,9 +9,6 @@ void termpty_save_free(Termpty *ty, Termsave *ts);
 Termsave *termpty_save_expand(Termpty *ty, Termsave *ts,
                               Termcell *cells, size_t delta);
 
-void       termpty_backlog_lock(void);
-void       termpty_backlog_unlock(void);
-
 void
 termpty_clear_backlog(Termpty *ty);
 void
diff --git a/src/bin/termio.c b/src/bin/termio.c
index f0d82e2c..10828dc5 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -2166,7 +2166,6 @@ _hyperlink_mouseover(Termio *sd,
 
    /* Scan the whole screen and display links as needed */
    termio_object_geometry_get(sd, &ox, &oy, &ow, &oh);
-   termpty_backlog_lock();
    termpty_backscroll_adjust(sd->pty, &sd->scroll);
    for (y = 0; y < sd->grid.h; y++)
      {
@@ -2236,7 +2235,6 @@ _hyperlink_mouseover(Termio *sd,
                }
           }
      }
-   termpty_backlog_unlock();
 }
 
 
diff --git a/src/bin/termiointernals.c b/src/bin/termiointernals.c
index 8ae19fa5..ec8191bd 100644
--- a/src/bin/termiointernals.c
+++ b/src/bin/termiointernals.c
@@ -38,7 +38,6 @@ termio_selection_get(Termio *sd,
        ty_sb_spaces_rtrim(sb);        \
 } while (0)
 
-   termpty_backlog_lock();
    for (y = c1y; y <= c2y; y++)
      {
         const Termcell *cells;
@@ -221,7 +220,6 @@ termio_selection_get(Termio *sd,
                }
           }
      }
-   termpty_backlog_unlock();
 
    RTRIM();
 
@@ -271,11 +269,10 @@ _sel_codepoints_get(const Termio *sd,
 #define TRY(ACTION) do {               \
      if (EINA_UNLIKELY(ACTION < 0))    \
        {                               \
-          goto err;                    \
+          return;                      \
        }                               \
 } while (0)
 
-   termpty_backlog_lock();
    for (y = c1y; y <= c2y; y++)
      {
         const Termcell *cells;
@@ -325,8 +322,6 @@ _sel_codepoints_get(const Termio *sd,
                }
           }
      }
-err:
-   termpty_backlog_unlock();
 }
 
 static void
@@ -468,8 +463,6 @@ _sel_line(Termio *sd, int cy)
    ssize_t w = 0;
    const Termcell *cells;
 
-   termpty_backlog_lock();
-
    termio_sel_set(sd, EINA_TRUE);
    sd->pty->selection.makesel = EINA_FALSE;
 
@@ -514,8 +507,6 @@ _sel_line(Termio *sd, int cy)
 
    sd->pty->selection.by_line = EINA_TRUE;
    sd->pty->selection.is_top_to_bottom = EINA_TRUE;
-
-   termpty_backlog_unlock();
 }
 
 static void
@@ -902,8 +893,6 @@ _sel_word(Termio *sd, int cx, int cy)
    ssize_t w = 0;
    Eina_Bool done = EINA_FALSE;
 
-   termpty_backlog_lock();
-
    termio_sel_set(sd, EINA_TRUE);
    sd->pty->selection.makesel = EINA_TRUE;
    sd->pty->selection.orig.x = cx;
@@ -1029,8 +1018,6 @@ _sel_word(Termio *sd, int cx, int cy)
    sd->pty->selection.is_top_to_bottom = EINA_TRUE;
 
    _trim_sel_word(sd);
-
-   termpty_backlog_unlock();
 }
 
 static void
@@ -1312,8 +1299,6 @@ _selection_newline_extend_fix(Termio *sd)
    if ((sd->top_left) || (sd->bottom_right) || (sd->pty->selection.is_box))
      return;
 
-   termpty_backlog_lock();
-
    start_x = sd->pty->selection.start.x;
    start_y = sd->pty->selection.start.y;
    end_x   = sd->pty->selection.end.x;
@@ -1356,8 +1341,6 @@ _selection_newline_extend_fix(Termio *sd)
    sd->pty->selection.start.y = start_y;
    sd->pty->selection.end.x = end_x;
    sd->pty->selection.end.y = end_y;
-
-   termpty_backlog_unlock();
 }
 
 void
@@ -1380,7 +1363,6 @@ termio_selection_dbl_fix(Termio *sd)
         INT_SWAP(start_x, end_x);
      }
 
-   termpty_backlog_lock();
    cells = termpty_cellrow_get(sd->pty, end_y - sd->scroll, &w);
    if (cells)
      {
@@ -1433,7 +1415,6 @@ termio_selection_dbl_fix(Termio *sd)
                }
           }
      }
-   termpty_backlog_unlock();
 
    if (!sd->pty->selection.is_top_to_bottom)
      {
@@ -2417,7 +2398,6 @@ termio_internal_render(Termio *sd,
      }
 
    inv = sd->pty->termstate.reverse;
-   termpty_backlog_lock();
    termpty_backscroll_adjust(sd->pty, &sd->scroll);
 
    /* Make selection bottom to top */
@@ -2966,7 +2946,6 @@ termio_internal_render(Termio *sd,
         preedit_x = x - sd->cursor.x;
         preedit_y = y - sd->cursor.y;
      }
-   termpty_backlog_unlock();
    *preedit_xp = preedit_x;
    *preedit_yp = preedit_y;
 }
diff --git a/src/bin/termiolink.c b/src/bin/termiolink.c
index 4c0e9f5c..ed06c99d 100644
--- a/src/bin/termiolink.c
+++ b/src/bin/termiolink.c
@@ -469,8 +469,6 @@ termio_link_find(const Evas_Object *obj, int cx, int cy,
 
    sc = termio_scroll_get(obj);
 
-   termpty_backlog_lock();
-
    y1 -= sc;
    y2 -= sc;
 
@@ -678,7 +676,6 @@ out:
           }
      }
 end:
-   termpty_backlog_unlock();
    ty_sb_free(&sb);
    return s;
 }
@@ -1429,8 +1426,6 @@ termio_color_find(const Evas_Object *obj, int cx, int cy,
 
    sc = termio_scroll_get(obj);
 
-   termpty_backlog_lock();
-
    y1 -= sc;
    y2 -= sc;
 
@@ -1524,7 +1519,6 @@ termio_color_find(const Evas_Object *obj, int cx, int cy,
    found = EINA_TRUE;
 
 end:
-   termpty_backlog_unlock();
    ty_sb_free(&sb);
    if (found)
      {
diff --git a/src/bin/termpty.c b/src/bin/termpty.c
index 0d473a1d..939bfa75 100644
--- a/src/bin/termpty.c
+++ b/src/bin/termpty.c
@@ -1125,8 +1125,6 @@ termpty_text_save_top(Termpty *ty, Termcell *cells, ssize_t w_max)
      return;
    assert(ty->back);
 
-   termpty_backlog_lock();
-
    w = termpty_line_length(cells, w_max);
    if (w > 1)
      _mark_autowrapped(cells, w - 1);
@@ -1155,7 +1153,6 @@ add_new_ts:
    ty->backpos++;
    if (ty->backpos >= ty->backsize)
      ty->backpos = 0;
-   termpty_backlog_unlock();
 
    ty->backlog_beacon.screen_y++;
    ty->backlog_beacon.backlog_y++;
@@ -1563,8 +1560,6 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
    if (ty->sync_output.active)
      termpty_sync_output_reset(ty);
 
-   termpty_backlog_lock();
-
    if (ty->altbuf)
      {
         termpty_screen_swap(ty);
@@ -1703,15 +1698,12 @@ termpty_resize(Termpty *ty, int new_w, int new_h)
 
    _pty_size(ty);
 
-   termpty_backlog_unlock();
-
    ty->backlog_beacon.backlog_y = 0;
    ty->backlog_beacon.screen_y = 0;
 
    return;
 
 bad:
-   termpty_backlog_unlock();
    free(new_screen);
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to