PTHREAD_SUSPEND_ALL_NP(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

🌸 NAME 🌸

Okay bestie, this is PTHREAD_SUSPEND_ALL_NP(3) from the Library Functions Manual, and the function is pthread_suspend_all_np β€” suspend all active threads. That's the whole name vibe. Periodt.

✨ LIBRARY ✨

POSIX Threads Library (libpthread, -lpthread) πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

#include <pthread_np.h>

void
pthread_suspend_all_np(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

So pthread_suspend_all_np() does exactly what the name says: it causes all active threads to be suspended. The only exception is the current thread β€” the thread that called the pthread_suspend_all_np() function. She gets to stay awake, main character energy and all πŸ’….

Big warning, no cap: it is not safe for the caller of pthread_suspend_all_np() to use any non-async signal safe functions, besides pthread_resume_all_np(3), until threads are resumed β€” unless measures are taken to ensure that all threads are suspended at safe points. Like, do not play games with this one, bestie 😭.

🌈 SEE ALSO 🌈

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Alexey Zelkin <phantom@FreeBSD.org> 🫢.


Cute little sign-off: this page's source/version energy is Debian, dated October 12, 2021 β€” PTHREAD_SUSPEND_ALL_NP(3) out, stay safe while your threads are suspended, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from