suitcase

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

npthread.h (1151B)


      1 #ifndef   NPTHREAD_NPTHREAD_H
      2 #define   NPTHREAD_NPTHREAD_H
      3 
      4 #include <sys/types.h>
      5 
      6 #define int64		int64_t
      7 
      8 #ifndef BERNSTEINLY_CORRECT
      9 #define thunktype	void*
     10 #define taitype		tai6464
     11 #else
     12 #define	taitype		taia
     13 #define thunktype	int64
     14 #endif
     15 
     16 #define threadnotype	uint64_t
     17 
     18 extern int npthread_add(int (*f)(thunktype n), thunktype);
     19 extern int npthread_addsignal(int (*f)(thunktype n), thunktype, int);
     20 
     21 extern int npthread_start(void);
     22 extern threadnotype *_sc_curthread();
     23 /* In the thread-unsafe version,
     24  * this will be implemented using a static.
     25  * in the thread-safe version, we will use pthread keys.
     26  * all of this will be transparent to the thread.
     27  */
     28 
     29 extern void npthread_jump(int (*f)(thunktype n), thunktype);
     30 extern void npthread_important(void);
     31 extern void npthread_unimportant(void);
     32 extern void npthread_child(pid_t);
     33 extern void npthread_childstatus(void); // uses thread local storage
     34 
     35 extern int64 npthread_newflag(void);
     36 extern void npthread_watchflag(int64);
     37 extern void npthread_waveflag(int64);
     38 
     39 extern void npthread_read(int64); // wants io_fd_t (int64)
     40 extern void npthread_write(int64);
     41 
     42 #endif // NPTHREAD_NPTHREAD_H