Ejemplo n.º 1
0
rrd_context_t *rrd_force_new_context(
    void)
{
    rrd_context_t *ctx;

    context_init_context();

    ctx = rrd_new_context();
    TlsSetValue(context_key, ctx);

    return ctx;
}
Ejemplo n.º 2
0
rrd_context_t *rrd_get_context(
    void)
{
    rrd_context_t *ctx;

    pthread_once(&context_key_once, context_get_key);
    ctx = pthread_getspecific(context_key);
    if (!ctx) {
        ctx = rrd_new_context();
        pthread_setspecific(context_key, ctx);
    }
    return ctx;
}
Ejemplo n.º 3
0
rrd_context_t *rrd_get_context(
    void)
{
    rrd_context_t *ctx;

    context_init_context();

    ctx = (rrd_context_t*)TlsGetValue(context_key);
    if (!ctx) {
        ctx = rrd_new_context();
        TlsSetValue(context_key, ctx);
    }
    return ctx;
}