#ifndef	THREAD_POSIX_H
#define	THREAD_POSIX_H

struct ThreadState {
	pthread_t td_;

	static void start(pthread_key_t key, Thread *td)
	{
		pthread_t self = pthread_self();

		td->state_->td_ = self;

		int rv = pthread_setspecific(key, td);
		if (rv == -1) {
			ERROR("/thread/state/start") << "Could not set thread-local Thread pointer.";
			return;
		}

#if defined(__FreeBSD__)
		pthread_set_name_np(self, td->name_.c_str());
#elif defined(__APPLE__)
		pthread_setname_np(td->name_.c_str());
#endif
	}
};



#endif /* !THREAD_POSIX_H */

Add missed file in previous revision.
Add missed file in previous revision.


git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@605 4068ffdb-0463-0410-8185-8cc71e3bd399
