Skip to content

Commit 17e1b1f

Browse files
committed
docs: add note in flux_signal_watcher_create(3)
Problem: signals should generally only be handled in the main thread of a multi-threaded program, but this is undocumented. Add a note to the signal watcher man page.
1 parent a75d3d2 commit 17e1b1f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

doc/man3/flux_signal_watcher_create.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ When one :var:`callback` is shared by multiple watchers, the signal number that
3737
triggered the event can be obtained with
3838
:func:`flux_signal_watcher_get_signum`.
3939

40+
Signal handling can be tricky in multi-threaded programs. It is advisable
41+
to handle signals in the main thread only. For example, block signals by
42+
calling :linux:man2:`sigprocmask` before spawning other threads, and register
43+
signal watchers only in the main thread.
4044

4145
RETURN VALUE
4246
============

doc/test/spell.en.pws

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,3 +940,4 @@ cPATH
940940
SATTR
941941
myprogram
942942
unref
943+
sigprocmask

0 commit comments

Comments
 (0)