thread-st.h

来自「MPI stands for the Message Passing Inter」· C头文件 代码 · 共 49 行

H
49
字号
/* * $Id:$ * Generic version: no threads. * by Wolfram Gloger 2004 */#include <stdio.h>struct thread_st {	char *sp;							/* stack pointer, can be 0 */	void (*func)(struct thread_st* st);	/* must be set by user */	int id;	int flags;	struct user_data u;};static voidthread_init(void){	printf("No threads.\n");}/* Create a thread. */static intthread_create(struct thread_st *st){	st->flags = 0;	st->id = 1;	st->func(st);	return 0;}/* Wait for one of several subthreads to finish. */static voidwait_for_thread(struct thread_st st[], int n_thr,				int (*end_thr)(struct thread_st*)){	int i;	for(i=0; i<n_thr; i++)		if(end_thr)			end_thr(&st[i]);}/* * Local variables: * tab-width: 4 * End: */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?