您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ threadexitsall函数代码示例

51自学网 2021-06-03 08:49:05
  C++
这篇教程C++ threadexitsall函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中threadexitsall函数的典型用法代码示例。如果您正苦于以下问题:C++ threadexitsall函数的具体用法?C++ threadexitsall怎么用?C++ threadexitsall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了threadexitsall函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: usage

voidusage(void){	fprint(2, "usage: printmap [-B blockcachesize] config/n");	threadexitsall("usage");}
开发者ID:npe9,项目名称:harvey,代码行数:6,


示例2: reader

voidreader(void *v){	int cfd, tfd, exiting, pid;	uintptr_t newpid;	char *ctl, *truss;	Str *s;	static char waitstop[] = "waitstop";	pid = (int)(uintptr)v;	if (debug)		fprint(outf, "DEBUG: -------------> reader starts with pid %d/n", pid);	ctl = smprint("/proc/%d/ctl", pid);	if ((cfd = open(ctl, OWRITE)) < 0)		die(smprint("%s: %r", ctl));	truss = smprint("/proc/%d/syscall", pid);	if ((tfd = open(truss, OREAD)) < 0)		die(smprint("%s: %r", truss));	if (debug)		fprint(outf, "DEBUG: Send %s to pid %d ...", waitstop, pid);	/* child was stopped by hang msg earlier */	cwrite(cfd, ctl, waitstop, sizeof waitstop - 1);	if (debug)		fprint(outf, "DEBUG: back for %d/n", pid);	if (debug)		fprint(outf, "DEBUG: Send %s to pid %d/n", "startsyscall", pid);	cwrite(cfd, ctl, "startsyscall", 12);	if (debug)		fprint(outf, "DEBUG: back for %d/n", pid);	s = newstr();	exiting = 0;	while((s->len = pread(tfd, s->buf, Bufsize - 1, 0)) >= 0){		if (s->buf[0] == 'F') {			char *val = strstr(s->buf, "= ");			if (val) {				newpid = strtol(&val[2], 0, 0);				sendp(forkc, (void*)newpid);				procrfork(reader, (void*)newpid, Stacksize, 0);			}		}		if (strstr(s->buf, " Exits") != nil)			exiting = 1;		sendp(out, s);	/* print line from /proc/$child/syscall */		if (exiting) {			s = newstr();			strcpy(s->buf, "/n");			sendp(out, s);			break;		}		/* flush syscall trace buffer */		if (debug)			fprint(outf, "DEBUG: Send %s to pid %d/n", "startsyscall", pid);		cwrite(cfd, ctl, "startsyscall", 12);		if (debug)			fprint(outf, "DEBUG: back for %d/n", pid);		s = newstr();	}	sendp(quit, nil);	threadexitsall(nil);}
开发者ID:aahud,项目名称:harvey,代码行数:65,


示例3: threadmain

voidthreadmain(int argc, char *argv[]){	char *dev;	char *args[Nels];	int i, j, nargs, check;	dev = "disk";	check = 0;	ARGBEGIN{	case 'c':		check++;		break;	case 'v':		verb++;		break;	case 'f':		dev = EARGF(usage());		break;	default:		if(ARGC() >= 'A' && ARGC() <= 'Z'){			dbg['d'] = 1;			dbg[ARGC()] = 1;		}else			usage();	}ARGEND;	if(argc == 0)		usage();	fatalaborts = 1;	fmtinstall('H', mbfmt);	fmtinstall('M', dirmodefmt);	fmtinstall('P', pathfmt);	errinit(Errstack);	if(catcherror()){		fprint(2, "cmd failed: %r/n");		threadexitsall("failed");	}	fsopen(dev, Normal, Wr);	for(i = 0; i < argc; i++){		if(verb>1)			fsdump(0, Mem);		print("%% %s/n", argv[i]);		nargs = gettokens(argv[i], args, Nels, "!");		for(j = 0; j < nelem(cmds); j++){			if(strcmp(cmds[j].name, argv[i]) != 0)				continue;			if(cmds[j].nargs != 0 && cmds[j].nargs != nargs)				fprint(2, "usage: %s/n", cmds[j].usage);			else				cmds[j].f(nargs, args);			break;		}		if(j == nelem(cmds)){			fprint(2, "no such command/n");			for(j = 0; j < nelem(cmds); j++)				fprint(2, "/t%s/n", cmds[j].usage);			break;		}		if(check){			print("%% check/n");			fscheck();		}	}	if(verb>1)		fsdump(0, Mem);	noerror();	threadexitsall(nil);}
开发者ID:99years,项目名称:plan9,代码行数:68,


示例4: usage

static voidusage(void){	fprint(2, "Usage: %s [-cd] [-m maxto] dialstring|netdir/n", progname);	threadexitsall("usage");}
开发者ID:Fluray,项目名称:NxM,代码行数:6,


示例5: usage

voidusage(void){	fprint(2, "usage: statusbar [-kt] [-W winsize] 'title'/n");	threadexitsall("usage");}
开发者ID:00001,项目名称:plan9port,代码行数:6,


示例6: threadmain

voidthreadmain(int argc, char *argv[]){	int i;	char *p, *loadfile;	Column *c;	int ncol;	Display *d;	rfork(RFENVG|RFNAMEG);	ncol = -1;	loadfile = nil;	ARGBEGIN{	case 'D':		{extern int _threaddebuglevel;		_threaddebuglevel = ~0;		}		break;	case 'a':		globalautoindent = TRUE;		break;	case 'b':		bartflag = TRUE;		break;	case 'c':		p = ARGF();		if(p == nil)			goto Usage;		ncol = atoi(p);		if(ncol <= 0)			goto Usage;		break;	case 'f':		fontnames[0] = ARGF();		if(fontnames[0] == nil)			goto Usage;		break;	case 'F':		fontnames[1] = ARGF();		if(fontnames[1] == nil)			goto Usage;		break;	case 'l':		loadfile = ARGF();		if(loadfile == nil)			goto Usage;		break;	case 'm':		mtpt = ARGF();		if(mtpt == nil)			goto Usage;		break;	case 'r':		swapscrollbuttons = TRUE;		break;	case 'W':		winsize = ARGF();		if(winsize == nil)			goto Usage;		break;	default:	Usage:		fprint(2, "usage: acme -a -c ncol -f fontname -F fixedwidthfontname -l loadfile -W winsize/n");		threadexitsall("usage");	}ARGEND	fontnames[0] = estrdup(fontnames[0]);	fontnames[1] = estrdup(fontnames[1]);	quotefmtinstall();	fmtinstall('t', timefmt);	cputype = getenv("cputype");	objtype = getenv("objtype");	home = getenv("HOME");	acmeshell = getenv("acmeshell");	if(acmeshell && *acmeshell == '/0')		acmeshell = nil;	p = getenv("tabstop");	if(p != nil){		maxtab = strtoul(p, nil, 0);		free(p);	}	if(maxtab == 0)		maxtab = 4;	if(loadfile)		rowloadfonts(loadfile);	putenv("font", fontnames[0]);	snarffd = open("/dev/snarf", OREAD|OCEXEC);/*	if(cputype){		sprint(buf, "/acme/bin/%s", cputype);		bind(buf, "/bin", MBEFORE);	}	bind("/acme/bin", "/bin", MBEFORE);*/	getwd(wdir, sizeof wdir);//.........这里部分代码省略.........
开发者ID:UNGLinux,项目名称:9base,代码行数:101,


示例7: threadmain

voidthreadmain(int argc, char *argv[]){	char buf[1024], *p;	int fd, i, input;	input = 0;	m.src = "plumb";	m.dst = nil;	m.wdir = getwd(buf, sizeof buf);	m.type = "text";	m.attr = nil;	ARGBEGIN{	case '9':		chatty9pclient = 1;		break;	case 'a':		p = ARGF();		if(p == nil)			usage();		m.attr = plumbaddattr(m.attr, plumbunpackattr(p));		break;	case 'd':		m.dst = ARGF();		if(m.dst == nil)			usage();		break;	case 'i':		input++;		break;	case 't':	case 'k':	/* for backwards compatibility */		m.type = ARGF();		if(m.type == nil)			usage();		break;	case 'p':		plumbfile = ARGF();		if(plumbfile == nil)			usage();		break;	case 's':		m.src = ARGF();		if(m.src == nil)			usage();		break;	case 'w':		m.wdir = ARGF();		if(m.wdir == nil)			usage();		break;	}ARGEND	if((input && argc>0) || (!input && argc<1))		usage();	if(plumbfile != nil)		fd = open(plumbfile, OWRITE);	else		fd = plumbopen("send", OWRITE);	if(fd < 0){		fprint(2, "plumb: can't open plumb file: %r/n");		threadexitsall("open");	}	if(input){		gather();		if(plumblookup(m.attr, "action") == nil)			m.attr = plumbaddattr(m.attr, plumbunpackattr("action=showdata"));		if(plumbsend(fd, &m) < 0){			fprint(2, "plumb: can't send message: %r/n");			threadexitsall("error");		}		threadexitsall(nil);	}	for(i=0; i<argc; i++){		if(input == 0){			m.data = argv[i];			m.ndata = -1;		}		if(plumbsend(fd, &m) < 0){			fprint(2, "plumb: can't send message: %r/n");			threadexitsall("error");		}	}	threadexitsall(nil);}
开发者ID:00001,项目名称:plan9port,代码行数:85,


示例8: usage

voidusage(void){	fprint(2, "usage: %s [-sd] [-h host] [-c ncache] [-m mountpoint] vacfile/n", argv0);	threadexitsall("usage");}
开发者ID:npe9,项目名称:harvey,代码行数:6,


示例9: usage

voidusage(void){	fprint(2, "usage: devdraw (don't run directly)/n");	threadexitsall("usage");}
开发者ID:fr1tz,项目名称:nadir,代码行数:6,


示例10: xls

//.........这里部分代码省略.........	CFid *fid;	CFsys *fs;	err = nil;	sort = 1;	lflag = dflag = tflag = 0;	ARGBEGIN{	case 'n':		sort = 0;		break;	case 'l':		lflag = 1;		break;	case 'd':		dflag = 1;		break;	case 't':		tflag = 1;		break;	}ARGEND		fmtinstall('D', dirfmt);	fmtinstall('M', dirmodefmt);	quotefmtinstall();	fmtinstall('T', timefmt);		if(argc == 0){		argv = dot;		argc = 1;	}	for(i=0; i<argc; i++){		name = argv[i];		fs = xparse(name, &xname);		if((d = fsdirstat(fs, xname)) == nil){			fprint(2, "dirstat %s: %r/n", name);			fsunmount(fs);			err = "errors";			continue;		}		if((d->mode&DMDIR) && !dflag){			if((fid = fsopen(fs, xname, OREAD)) == nil){				fprint(2, "open %s: %r/n", name);				fsunmount(fs);				free(d);				err = "errors";				continue;			}			free(d);			n = fsdirreadall(fid, &d);			fsclose(fid);			if(n < 0){				fprint(2, "dirreadall %s: %r/n", name);				fsunmount(fs);				err = "errors";				continue;			}			if(sort){				if(tflag)					qsort(d, n, sizeof d[0], timecmp);				else					qsort(d, n, sizeof d[0], dircmp);			}			for(j=0; j<4; j++)				len[j] = 0;			for(i=0; i<n; i++){				d[i].type = 'M';				d[i].dev = 0;				snprint(buf, sizeof buf, "%d %s %s %lld",					d[i].dev, d[i].uid, d[i].gid, d[i].length);				getfields(buf, f, 4, 0, " ");				for(j=0; j<4; j++){					l = strlen(f[j]);					if(l > len[j])						len[j] = l;				}			}			for(i=0; i<n; i++){				if(!lflag){					print("%q/n", d[i].name);					continue;				}				print("%M %C %*d %*s %*s %*lld %T %q/n",					d[i].mode, d[i].type, len[0], d[i].dev,					-len[1], d[i].uid, -len[2], d[i].gid,					len[3], d[i].length, d[i].mtime, d[i].name);			}		}else{			d->type = 'M';			d->dev = 0;			if(lflag)				print("%M %C %d %s %s %lld %T %q/n",					d->mode, d->type, d->dev,					d->uid, d->gid, d->length, d->mtime, d->name);			else				print("%q/n", d->name);		}		free(d);	}	threadexitsall(err);}
开发者ID:00001,项目名称:plan9port,代码行数:101,


示例11: threadmain

voidthreadmain(int argc, char *argv[]){	int i, j, k, l;	Image *dark;	ramp = 0;	fmt = "index %3d r %3lud g %3lud b %3lud 0x%.8luX        ";	ARGBEGIN{	default:		goto Usage;	case 'D':		chattydrawclient = 1;		break;	case 'x':		fmt = "index %2luX r %3luX g %3luX b %3luX 0x%.8luX       ";		break;	case 'r':		ramp = 1;		break;	}ARGEND	if(argc){	Usage:		fprint(2, "Usage: %s [-rx]/n", argv0);		threadexitsall("usage");	}	if(initdraw(0, nil, "colors") < 0)		sysfatal("initdraw failed: %r");	mousectl = initmouse(nil, display->image);	if(mousectl == nil)		sysfatal("initmouse: %r");	keyboardctl = initkeyboard(nil);	if(keyboardctl == nil)		sysfatal("initkeyboard: %r");	for(i=0; i<256; i++){		if(ramp){			if(screen->chan == CMAP8){				/* dither the fine grey */				j = i-(i%17);				dark = allocimage(display, Rect(0,0,1,1), screen->chan, 1, (grey(j)<<8)+0xFF);				color[i] = allocimage(display, Rect(0,0,4,4), screen->chan, 1, (grey(j+17)<<8)+0xFF);				for(j=0; j<16; j++){					k = j%4;					l = j/4;					if(dither[j] > (i%17))						draw(color[i], Rect(k, l, k+1, l+1), dark, nil, ZP);				}				freeimage(dark);			}else				color[i] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, (grey(i)<<8)+0xFF);		}else			color[i] = allocimage(display, Rect(0,0,1,1), screen->chan, 1, (cmap2rgb(i)<<8)+0xFF);		if(color[i] == nil)			sysfatal("can't allocate image: %r");	}	threadcreate(mousethread, nil, STACK);	threadcreate(keyboardthread, nil, STACK);	threadcreate(resizethread, nil, STACK);}
开发者ID:00001,项目名称:plan9port,代码行数:66,


示例12: usage

voidusage(void){	fprint(2, "usage: plumb [-p plumbfile] [-a 'attr=value ...'] [-s src] [-d dst] [-t type] [-w wdir] -i | data1/n");	threadexitsall("usage");}
开发者ID:00001,项目名称:plan9port,代码行数:6,


示例13: usage

static voidusage(void){	fprint(2, "usage: %s [-Dd] [-N nb] [-m mnt] [-s srv] [dev...]/n", argv0);	threadexitsall("usage");}
开发者ID:CoryXie,项目名称:nix-os,代码行数:6,


示例14: mboxcommand

intmboxcommand(Window *w, char *s){	char *args[10], **targs, *save;	Window *sbox;	Message *m, *next;	int ok, nargs, i, j;	CFid *searchfd;	char buf[128], *res;	nargs = tokenize(s, args, nelem(args));	if(nargs == 0)		return 0;	if(strcmp(args[0], "Mail") == 0){		if(nargs == 1)			mkreply(nil, "Mail", "", nil, nil);		else			mkreply(nil, "Mail", args[1], nil, nil);		return 1;	}	if(strcmp(s, "Del") == 0){		if(mbox.dirty){			mbox.dirty = 0;			fprint(2, "mail: mailbox not written/n");			return 1;		}		if(w != mbox.w){			windel(w, 1);			return 1;		}		ok = 1;		for(m=mbox.head; m!=nil; m=next){			next = m->next;			if(m->w){				if(windel(m->w, 0))					m->w = nil;				else					ok = 0;			}		}		for(m=replies.head; m!=nil; m=next){			next = m->next;			if(m->w){				if(windel(m->w, 0))					m->w = nil;				else					ok = 0;			}		}		if(ok){			windel(w, 1);			removeupasfs();			threadexitsall(nil);		}		return 1;	}	if(strcmp(s, "Put") == 0){		rewritembox(wbox, &mbox);		return 1;	}	if(strcmp(s, "Get") == 0){		fswrite(mbox.ctlfd, "refresh", 7);		return 1;	}	if(strcmp(s, "Delmesg") == 0){		save = nil;		if(nargs > 1)			save = args[1];		s = winselection(w);		if(s == nil)			return 1;		nargs = 1;		for(i=0; s[i]; i++)			if(s[i] == '/n')				nargs++;		targs = emalloc(nargs*sizeof(char*));	/* could be too many for a local array */		nargs = getfields(s, targs, nargs, 1, "/n");		for(i=0; i<nargs; i++){			if(!isdigit(targs[i][0]))				continue;			j = atoi(targs[i]);	/* easy way to parse the number! */			if(j == 0)				continue;			snprint(buf, sizeof buf, "%s%d", mbox.name, j);			delmesg(buf, nil, 1, save);		}		free(s);		free(targs);		return 1;	}	if(strcmp(s, "Search") == 0){		if(nargs <= 1)			return 1;		s = estrstrdup(mboxname, "/search");		searchfd = fsopen(mailfs, s, ORDWR);		if(searchfd == nil)			return 1;		save = estrdup(args[1]);		for(i=2; i<nargs; i++)			save = eappend(save, " ", args[i]);//.........这里部分代码省略.........
开发者ID:00001,项目名称:plan9port,代码行数:101,


示例15: usage

voidusage(void){	fprint(2, "usage: findscore [-v] arenafile score/n");	threadexitsall(0);}
开发者ID:00001,项目名称:plan9port,代码行数:6,


示例16: threadmain

voidthreadmain(int argc, char *argv[]){	int type, n;	uchar score[VtScoreSize];	uchar *buf;	VtConn *z;	char *host;	fmtinstall('F', vtfcallfmt);	fmtinstall('V', vtscorefmt);	host = nil;	type = -1;	ARGBEGIN{	case 'h':		host = EARGF(usage());		break;	case 't':		type = atoi(EARGF(usage()));		break;	default:		usage();		break;	}ARGEND	if(argc != 1)		usage();	if(vtparsescore(argv[0], nil, score) < 0)		sysfatal("could not parse score '%s': %r", argv[0]);	buf = vtmallocz(VtMaxLumpSize);	z = vtdial(host);	if(z == nil)		sysfatal("could not connect to server: %r");	if(vtconnect(z) < 0)		sysfatal("vtconnect: %r");	if(type == -1){		n = -1;		for(type=0; type<VtMaxType; type++){			n = vtread(z, score, type, buf, VtMaxLumpSize);			if(n >= 0){				fprint(2, "venti/read%s%s %V %d/n", host ? " -h" : "", host ? host : "",					score, type);				break;			}		}	}else		n = vtread(z, score, type, buf, VtMaxLumpSize);	vthangup(z);	if(n < 0)		sysfatal("could not read block: %r");	if(write(1, buf, n) != n)		sysfatal("write: %r");	threadexitsall(0);}
开发者ID:99years,项目名称:plan9,代码行数:61,


示例17: threadmain

//.........这里部分代码省略.........		if(verbose)			fprint(2, "archive %s/%s/n", yyyy, mmdd);	}else{		if(vacfile == nil)			outfd = 1;		else if((outfd = create(vacfile, OWRITE, 0666)) < 0)			sysfatal("create %s: %r", vacfile);		atexit(removevacfile);		if((fs = vacfscreate(z, blocksize, CacheSize)) == nil)			sysfatal("vacfscreate: %r");		f = vacfsgetroot(fs);		fdiff = nil;		if(diffvac){			if((fsdiff = vacfsopen(z, diffvac, VtOREAD, CacheSize)) == nil)				warn("vacfsopen %s: %r", diffvac);			else				fdiff = vacfsgetroot(fsdiff);		}	}	if(stdinname)		vacstdin(f, stdinname);	for(i=0; i<argc; i++){		// We can't use / and . and .. and ../.. as valid archive		// names, so expand to the list of files in the directory.		if(argv[i][0] == 0){			warn("empty string given as command-line argument");			continue;		}		cleanname(argv[i]);		if(strcmp(argv[i], "/") == 0		|| strcmp(argv[i], ".") == 0		|| strcmp(argv[i], "..") == 0		|| (strlen(argv[i]) > 3 && strcmp(argv[i]+strlen(argv[i])-3, "/..") == 0)){			if((fd = open(argv[i], OREAD)) < 0){				warn("open %s: %r", argv[i]);				continue;			}			while((n = dirread(fd, &d)) > 0){				for(j=0; j<n; j++){					s = vtmalloc(strlen(argv[i])+1+strlen(d[j].name)+1);					strcpy(s, argv[i]);					strcat(s, "/");					strcat(s, d[j].name);					cleanname(s);					vac(f, fdiff, s, &d[j]);				}				free(d);			}			close(fd);			continue;		}		if((d = dirstat(argv[i])) == nil){			warn("stat %s: %r", argv[i]);			continue;		}		vac(f, fdiff, argv[i], d);		free(d);	}	if(fdiff)		vacfiledecref(fdiff);		/*	 * Record the maximum qid so that vacs can be merged	 * without introducing overlapping qids.  Older versions	 * of vac arranged that the root would have the largest	 * qid in the file system, but we can't do that anymore	 * (the root gets created first!).	 */	if(_vacfsnextqid(fs, &qid) >= 0)		vacfilesetqidspace(f, 0, qid);	vacfiledecref(f);	/*	 * Copy fsdiff's root block score into fs's slot for that,	 * so that vacfssync will copy it into root.prev for us.	 * Just nice documentation, no effect.	 */	if(fsdiff)		memmove(fs->score, fsdiff->score, VtScoreSize);	if(vacfssync(fs) < 0)		fprint(2, "vacfssync: %r/n");	fprint(outfd, "vac:%V/n", fs->score);	atexitdont(removevacfile);	vacfsclose(fs);	vthangup(z);	if(printstats){		fprint(2,			"%d files, %d files skipped, %d directories/n"			"%lld data bytes written, %lld data bytes skipped/n",			stats.nfile, stats.skipfiles, stats.ndir, stats.data, stats.skipdata);		dup(2, 1);		packetstats();	}	threadexitsall(0);}
开发者ID:stroucki,项目名称:plan9port,代码行数:101,


示例18: threadmain

voidthreadmain(int argc, char *argv[]){	int n;	uchar score[VtScoreSize];	uchar *buf;	char *host, *type;	vlong off;	VtEntry e;	VtRoot root;	VtCache *c;	VtConn *z;	VtFile *f;	quotefmtinstall();	fmtinstall('F', vtfcallfmt);	fmtinstall('V', vtscorefmt);	host = nil;	ARGBEGIN{	case 'V':		chattyventi++;		break;	case 'h':		host = EARGF(usage());		break;	case 'v':		chatty++;		break;	default:		usage();		break;	}ARGEND	if(argc != 1)		usage();	type = nil;	if(vtparsescore(argv[0], &type, score) < 0)		sysfatal("could not parse score '%s': %r", argv[0]);	if(type == nil || strcmp(type, "file") != 0)		sysfatal("bad score - not file:...");	buf = vtmallocz(VtMaxLumpSize);	z = vtdial(host);	if(z == nil)		sysfatal("could not connect to server: %r");	if(vtconnect(z) < 0)		sysfatal("vtconnect: %r");	// root block ...	n = vtread(z, score, VtRootType, buf, VtMaxLumpSize);	if(n < 0)		sysfatal("could not read root %V: %r", score);	if(n != VtRootSize)		sysfatal("root block %V is wrong size %d != %d", score, n, VtRootSize);	if(vtrootunpack(&root, buf) < 0)		sysfatal("unpacking root block %V: %r", score);	if(strcmp(root.type, "file") != 0)		sysfatal("bad root type %q (not 'file')", root.type);	if(chatty)		fprint(2, "%V: %q %q %V %d %V/n",			score, root.name, root.type,			root.score, root.blocksize, root.prev);	// ... points at entry block	n = vtread(z, root.score, VtDirType, buf, VtMaxLumpSize);	if(n < 0)		sysfatal("could not read entry %V: %r", root.score);	if(n != VtEntrySize)		sysfatal("dir block %V is wrong size %d != %d", root.score, n, VtEntrySize);	if(vtentryunpack(&e, buf, 0) < 0)		sysfatal("unpacking dir block %V: %r", root.score);	if((e.type&VtTypeBaseMask) != VtDataType)		sysfatal("not a single file");	// open and read file	c = vtcachealloc(z, root.blocksize*32);	if(c == nil)		sysfatal("vtcachealloc: %r");	f = vtfileopenroot(c, &e);	if(f == nil)		sysfatal("vtfileopenroot: %r");	off = 0;	vtfilelock(f, VtOREAD);	while((n = vtfileread(f, buf, VtMaxLumpSize, off)) > 0){		write(1, buf, n);		off += n;	}	threadexitsall(0);}
开发者ID:00001,项目名称:plan9port,代码行数:93,



注:本文中的threadexitsall函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ threadgroup_change_begin函数代码示例
C++ thread_yield函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。