GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
PTHREAD_SWITCH_ADD_NP(3) FreeBSD Library Functions Manual PTHREAD_SWITCH_ADD_NP(3)

pthread_switch_add_np, pthread_switch_delete_np
thread context switches debugging primitives

POSIX Threads Library (libpthread, -lpthread)

#include <pthread_np.h>

int
pthread_switch_add_np(pthread_switch_routine_t routine);

int
pthread_switch_delete_np(pthread_switch_routine_t routine);

An application is allowed to monitor the thread context switches inside the threading library. An application can install a routine that gets called every time a thread (explicitly created by an application with the pthread_create(3) function) gets the context switched. The routine is passed the thread IDs of the threads that are being switched in and out. Installation and removal of these hooks may be done using the pthread_switch_add_np() and pthread_switch_delete_np() functions respectively.

If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.

The pthread_switch_add_np() may fail if:
[]
pointer was passed in the routine argument.

The pthread_switch_delete_np() may fail if:

[]
The routine argument is different from the argument previously passed to the pthread_switch_add_np() function.

pthread_create(3), pthread_np(3)

This manual page was written by Alexey Zelkin <phantom@FreeBSD.org>.
October 12, 2021 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.