PERFORCE change 75116 for review

David Xu davidxu at FreeBSD.org
Wed Apr 13 19:11:47 PDT 2005


http://perforce.freebsd.org/chv.cgi?CH=75116

Change 75116 by davidxu at davidxu_celeron on 2005/04/14 02:10:51

	Create a new thread creating syscall, the syscall create
	new thread in atomic.

Affected files ...

.. //depot/projects/davidxu_thread/src/sys/sys/thr.h#4 edit

Differences ...

==== //depot/projects/davidxu_thread/src/sys/sys/thr.h#4 (text+ko) ====

@@ -34,13 +34,32 @@
 #define	THR_SUSPENDED		0x0001
 /* Create the system scope thread. */
 #define	THR_SYSTEM_SCOPE	0x0002
+/* Remember user TID address in kernel, when exits,
+   write zero to the address and do umtx_wake()
+   on the address, the pthread_join can use this feature. */
+#define	THR_REMBER_TID_ADDRESS	0x0004
 
+struct thr_param {
+    void	(*start_func)(void *);	/* thread entry function. */
+    char	*stack_base;		/* stack base address. */
+    size_t	stack_size;		/* stack size. */
+    char	*tls_base;		/* tls base address. */
+    size_t	tls_size;		/* tls size. */
+    int		tls_seg;		/* which seg is to set for tls. */
+    sigset_t	sigmask;		/* signal mask for new thread. */
+    long	*child_tid;		/* address to store new TID. */
+    long	parent_tid;		/* parent accesses the new TID here. */
+    int		*user_crit;		/* reserved */
+    int		flags;
+};
+
 /* 
  * See pthread_*
  */
 #ifndef _KERNEL
 
 int thr_create(ucontext_t *ctx, long *id, int flags);
+int thr_create2(struct thr_param *param, int param_size);
 int thr_self(long *id);
 void thr_exit(long *state);
 int thr_kill(long id, int sig);


More information about the p4-projects mailing list