From e9a0a304083bbe5beb160f551e15ca4cea34e118 Mon Sep 17 00:00:00 2001 From: jfreegman Date: Sun, 5 Dec 2021 17:03:42 -0500 Subject: [PATCH] Some documentation improvements --- doc/toxic.1 | 8 ++++---- doc/toxic.1.asc | 4 ++-- doc/toxic.conf.5 | 4 ++-- src/settings.h | 2 +- src/toxic.c | 3 +++ src/windows.h | 7 +++++++ 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/doc/toxic.1 b/doc/toxic.1 index e53eb07..e5ad501 100644 --- a/doc/toxic.1 +++ b/doc/toxic.1 @@ -2,12 +2,12 @@ .\" Title: toxic .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 2020-05-04 +.\" Date: 2021-05-24 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC" "1" "2020\-05\-04" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC" "1" "2021\-05\-24" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -153,9 +153,9 @@ Configuration example\&. .sp \-Unicode characters with a width larger than 1 column may cause strange behaviour\&. .sp -\-Text occasionally fails to auto\-scroll to the bottom\&. -.sp \-Screen flickering sometimes occurs on certain terminals\&. +.sp +\-Resizing the terminal window when a game window is open will break things\&. .SH "AUTHORS" .sp JFreegman diff --git a/doc/toxic.1.asc b/doc/toxic.1.asc index 3317bde..6764fb6 100644 --- a/doc/toxic.1.asc +++ b/doc/toxic.1.asc @@ -89,10 +89,10 @@ BUGS -Unicode characters with a width larger than 1 column may cause strange behaviour. --Text occasionally fails to auto-scroll to the bottom. - -Screen flickering sometimes occurs on certain terminals. +-Resizing the terminal window when a game window is open will break things. + AUTHORS ------- JFreegman diff --git a/doc/toxic.conf.5 b/doc/toxic.conf.5 index be3aa27..9ecf050 100644 --- a/doc/toxic.conf.5 +++ b/doc/toxic.conf.5 @@ -2,12 +2,12 @@ .\" Title: toxic.conf .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.79.1 -.\" Date: 2020-12-05 +.\" Date: 2021-05-24 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC\&.CONF" "5" "2020\-12\-05" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC\&.CONF" "5" "2021\-05\-24" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/src/settings.h b/src/settings.h index 3bbe9ce..c77cf43 100644 --- a/src/settings.h +++ b/src/settings.h @@ -32,7 +32,7 @@ #define PASSWORD_EVAL_MAX 512 -/* holds user setting values */ +/* Holds user setting values defined in the toxic config file. */ struct user_settings { int autolog; /* boolean */ int alerts; /* boolean */ diff --git a/src/toxic.c b/src/toxic.c index efefcc7..58ce1d1 100644 --- a/src/toxic.c +++ b/src/toxic.c @@ -101,6 +101,9 @@ struct Winthread Winthread; struct cqueue_thread cqueue_thread; struct av_thread av_thread; struct arg_opts arg_opts; + +// This struct is not thread safe. It should only ever be written to from the main thread +// before any other thread that uses it is initialized. struct user_settings *user_settings = NULL; static struct user_password { diff --git a/src/windows.h b/src/windows.h index c4a2b12..a8eae00 100644 --- a/src/windows.h +++ b/src/windows.h @@ -98,6 +98,13 @@ typedef enum { Uncomment if necessary */ /* #define URXVT_FIX */ +/* + * Used to control access to global variables via a mutex, as well as to handle signals. + * Any file, variable or data structure that is used by the UI/Window thread and any other thread + * must be guarded by `lock`. + * + * There should only ever be one instance of this struct. + */ struct Winthread { pthread_t tid; pthread_mutex_t lock;