FreeBSD/lib/libthr/thread/thr_info.c
/* Set the thread name for debug. */
Set the thread name for debug.
Set the thread name for debug .
void
_pthread_set_name_np(pthread_t thread, const char *name)
{
	struct pthread *curthread = _get_curthread();
	int ret = 0;
	if (curthread == thread) {
		if (thr_set_name(thread->tid, name))
			ret = errno;
	} else {
		if ((ret=_thr_find_thread(curthread, thread, 0)) == 0) {
			if (thread->state != PS_DEAD) {
				if (thr_set_name(thread->tid, name))
					ret = errno;
			}
			THR_THREAD_UNLOCK(curthread, thread);
		}
	}
#if 0
	return (ret);
#endif
}
void _pthread_set_name_np ( pthread_t thread , const char * name ) { struct pthread * curthread = _get_curthread ( ) ; int ret = 0 ; if ( curthread == thread ) { if ( thr_set_name ( thread -> tid , name ) ) ret = errno ; } else { if ( ( ret = _thr_find_thread ( curthread , thread , 0 ) ) == 0 ) { if ( thread -> state != PS_DEAD ) { if ( thr_set_name ( thread -> tid , name ) ) ret = errno ; } THR_THREAD_UNLOCK ( curthread , thread ) ; } } #if 0 return ( ret ) ; #endif }
Set the thread name for debug.
Set the thread name for debug .
/* XXX should return error code. */