/// <summary> /// Sets the thread exit callback. /// </summary> private static unsafe int SetThreadExitCallbackLibpthread(IntPtr callbackPtr) { int tlsIndex; CheckResult(NativeMethodsLinuxLibpthread.pthread_key_create(new IntPtr(&tlsIndex), callbackPtr)); return(tlsIndex); }
/// <summary> /// Enables thread exit event for current thread. /// </summary> private static void EnableCurrentThreadExitEventLibpthread(int callbackId, IntPtr threadLocalValue) { CheckResult(NativeMethodsLinuxLibpthread.pthread_setspecific(callbackId, threadLocalValue)); }
/// <summary> /// Removes thread exit callback that has been set with <see cref="SetThreadExitCallback"/>. /// </summary> private static void RemoveThreadExitCallbackLibpthread(int callbackId) { CheckResult(NativeMethodsLinuxLibpthread.pthread_key_delete(callbackId)); }