/*
Copyright (c) 1993 Xerox Corporation.  All rights reserved.
*/
/*
$Id$

$Date$
 *
 * PCR←ThSpecific.h
 *
 * Thread-specific data interface.
 */

#include <config/PCR←StdDefs.h>

/*
 * Data id & key:
 */

typedef unsigned PCR←ThSpecific←Key;

typedef volatile PCR←ThSpecific←Key * PCR←ThSpecific←KeyPtr;

#define PCR←ThSpecific←Key←none	((PCR←ThSpecific←Key)(-1))
    /* not a legal key value */

/*
 * Key creation
 */

extern PCR←ERes
PCR←ThSpecific←CreateKey(
    void * id,
    PCR←ThSpecific←KeyPtr kp, 
    void (*destructor)(void *)
);
/*
    Set *kp to a key corresponding to id.
    If id is NIL, a new key is will be created.
    If id is non-NIL, and a key has already been created
      for id, then that existing key will be returned.
*/

/*
 * Data getter/setter functions
 */

extern PCR←ERes
PCR←ThSpecific←Set(PCR←ThSpecific←Key k, void * val);

extern PCR←ERes
PCR←ThSpecific←Get(PCR←ThSpecific←Key k, void ** val);

/*
$Log$
*/