Exemplo n.º 1
0
void *
u_tsd_get(struct u_tsd *tsd)
{
    if (tsd->initMagic != (int) INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    return pthread_getspecific(tsd->key);
}
Exemplo n.º 2
0
void
u_tsd_set(struct u_tsd *tsd, void *ptr)
{
    if (tsd->initMagic != (int) INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    tls_set(tsd->key, ptr);
}
Exemplo n.º 3
0
void *
u_tsd_get(struct u_tsd *tsd)
{
    if (tsd->initMagic != (int) INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    return tls_get(tsd->key);
}
Exemplo n.º 4
0
void *
u_tsd_get(struct u_tsd *tsd)
{
    if (tsd->initMagic != INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    return TlsGetValue(tsd->key);
}
Exemplo n.º 5
0
void
u_tsd_set(struct u_tsd *tsd, void *ptr)
{
    if (tsd->initMagic != (int) INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    if (pthread_setspecific(tsd->key, ptr) != 0) {
        perror(SET_TSD_ERROR);
        exit(-1);
    }
}
Exemplo n.º 6
0
void
u_tsd_set(struct u_tsd *tsd, void *ptr)
{
    /* the following code assumes that the struct u_tsd has been initialized
       to zero at creation */
    if (tsd->initMagic != INIT_MAGIC) {
        u_tsd_init(tsd);
    }
    if (TlsSetValue(tsd->key, ptr) == 0) {
        perror(SET_TSD_ERROR);
        InsteadOf_exit(-1);
    }
}
Exemplo n.º 7
0
static void
u_current_init_tsd(void)
{
   u_tsd_init(&u_current_table_tsd);
   u_tsd_init(&u_current_user_tsd);
}