thr_exit(2freebsd)

thr_exit2freebsd

Terminate current thread

Usage

#include <sys/thr.h>

void

thr_exit(long *state);

Library

Standard C Library (libc, -lc)

Overview

This function is intended for implementing threading. Normal applications should call pthread_exit(3) instead.

The thr_exit() system call terminates the current kernel-scheduled thread.

If the state argument is not NULL, the location pointed to by the argument is updated with an arbitrary non-zero value, and an _umtx_op(2) UMTX_OP_WAKE operation is consequently performed on the location.

Attempts to terminate the last thread in the process are silently ignored. Use _exit(2) syscall to terminate the process.

Return values

The function does not return a value. A return from the function indicates that the calling thread was the last one in the process.

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9
  2. 10
  3. 11–13

Standards

The thr_exit() system call is non-standard and is used by library “libthr” to implement IEEE Std 1003.1-2001 (“POSIX.1”) pthread(3) functionality.

From freebsd-manpages 12.2-2 in Debian 13 (Trixie). Parsed by carta from the page's mdoc source.