diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:38:54 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 12:38:54 +0300 |
| commit | 6ee9eb37d8e616a972fb29b3fbdbc33991aa844f (patch) | |
| tree | 5b257df9f1301f00ca5de49de60c56be45c67274 /include/term | |
| parent | caf7d446446a0af0b30886a6c4ee5851aab553e2 (diff) | |
| parent | e3d8fe4854a7ef7ff0637688cda9e65feb680122 (diff) | |
Merge branch 'wt/lock' into api-hardening
# Conflicts:
# src/screen.c
# tests/term_test.c
Diffstat (limited to 'include/term')
| -rw-r--r-- | include/term/term.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/term/term.h b/include/term/term.h index 9d5a882..d8758e7 100644 --- a/include/term/term.h +++ b/include/term/term.h @@ -17,8 +17,9 @@ * * Threads. Any thread can call any function. Each call that reads or changes * a terminal enters its writer section, so calls on one terminal run one at a - * time. A snapshot belongs to one thread at a time. term_free() is the last - * call on a terminal. + * time. A thread that waits for the section sleeps. On POSIX the section is a + * mutex with priority inheritance where the platform has it. A snapshot + * belongs to one thread at a time. term_free() is the last call on a terminal. */ #include <stdbool.h> @@ -196,9 +197,10 @@ TERM_API struct term *term_new(const struct term_options *opt); TERM_API void term_free(struct term *t); /* Hold the writer section across several calls, so that no other thread - * changes the terminal between them. The section is a spin lock: keep it - * short. The thread that holds it can call every function, and it can enter - * the section again. */ + * changes the terminal between them. The section is a mutex, and a waiting + * thread sleeps. Keep it short. The thread that holds it can call every + * function, and it can enter the section again. Each term_lock() needs one + * term_unlock(). */ TERM_API void term_lock(struct term *t); TERM_API void term_unlock(struct term *t); |
