Пример #1
0
/*
 *	Set thread specific "global" variable,
 *	using new POSIX routines.
 *	Crash and burn if the thread given isn't the calling thread.
 *	XXX For compatibility with old cthread_set_data() XXX
 */
int
cthread_set_data(cthread_t t, void *x)
{
    register cthread_t	self;

    self = cthread_self();
    if (t == self)
        return(cthread_setspecific(CTHREAD_KEY_RESERVED, x));
    else {
        ASSERT(t == self);
        return(-1);
    }
}
Пример #2
0
int
ldap_pvt_thread_key_setdata( ldap_pvt_thread_key_t key, void *data )
{
	return cthread_setspecific( key, data );
}