1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 06:50:39 -08:00
emacs/mps/code/pthrdext.h
Nick Barnes 7acfca905d Branch imports for masters.
Copied from Perforce
 Change: 23678
 ServerID: perforce.ravenbrook.com
2001-10-31 14:40:56 +00:00

68 lines
1.5 KiB
C

/* impl.h.pthreadext: POSIX THREAD EXTENSIONS
*
* $HopeName: $
* Copyright (C) 2000 Harlequin Ltd, all rights reserved
*
* .readership: MM developers.
*
* .purpose: Provides extension to Pthreads.
*/
#ifndef pthreadext_h
#define pthreadext_h
#include <signal.h>
#include "mpm.h"
#define PThreadextSig ((Sig)0x519B286E) /* SIGnature PTHReadExt */
/* PThreadext -- extension datatype */
typedef struct PThreadextStruct *PThreadext;
/* PThreadextStruct -- structure definition
*
* Should be embedded in a client structure
*/
typedef struct PThreadextStruct {
Sig sig; /* design.mps.sig */
pthread_t id; /* Thread ID */
struct sigcontext *suspendedScp; /* sigcontext if suspended */
RingStruct threadRing; /* ring of suspended threads */
RingStruct idRing; /* duplicate suspensions for id */
} PThreadextStruct;
/* PThreadextCheck -- Check a pthreadext */
extern Bool PThreadextCheck(PThreadext pthreadext);
/* PThreadextInit -- Initialize a pthreadext */
extern void PThreadextInit(PThreadext pthreadext, pthread_t id);
/* PThreadextFinish -- Finish a pthreadext */
extern void PThreadextFinish(PThreadext pthreadext);
/* PThreadextSuspend -- Suspend a pthreadext and return its context. */
extern Res PThreadextSuspend(PThreadext pthreadext,
struct sigcontext **contextReturn);
/* PThreadextResume -- Resume a suspended pthreadext */
extern Res PThreadextResume(PThreadext pthreadext);
#endif /* pthreadext_h */